subject

In this assignment you will implement a program called nursery_inv3.cpp to process the customer purchase orders for a nursery. The purchase orders will be stored in order records. Each order record contains ten fields, which are as follows: 1) a plant name (string, no spaces), 2) a county name (string, no space), 3) the cost of the plant ( double), 4) the quantity of plants in the purchase (integer), 5) the tax on the purchase (double), 6) the net cost of the purchase (double), 7) the discount rate (double), 8) discount on the purchase (double), 9) the purchase tax (double), and 10) the total cost of the purchase (double). Your program will have 3 functions:input, process, and output. Your main program will call (invoke) each function until the end of the data file has been reached. Following are the descriptions of the functionality of each function: 1. The void function "input" will have two parameters: an input file streamcalled "in", and a customer purchase order record called "order_record". Both arguments will be passed by reference. The function will read a plant name (pname), the name of the county the plant was purchase in (ename), the cost of the plant (plant_cost), and the quantity of the plant purchase (quantity) into an order record from the data file, "nursery_stock. txt".
2. The void function "process" will have one argurment, the order record, which will be passed by reference. The function will calculate the net cost of the purchase (net_cost), the tax on the purchase (purchase_tax), the discount on the purchase (discount), and the total cost of the purchase (total_cost). Please consider the following information to help you implement the necessary calculations:
a. The tax rate (in percent) on a purchase is based on the county where the purchase was made. If the county was dade, the tax rate is 6.5%; if the county is broward the tax rate is 6%; if the county was palm, the tax rate is 7%.
b. The net cost of a purchase is calculated by the following formula: β€’ net_cost=(quantity x plant_cost)
c. The discount is based on the quantity of plants in the purchase. The discount is determined is follows: β€’ If quantity equals 0, then the discount is 0% of the net cost; β€’ Ifi<=quantity <=5 then discount = 1% of the net cost; 6<=quantity <=11 then discount = 3% of the net cost;if 12<=quantity <=20 then discount = 5% of the net cost;21<=quantity <=50 then discount = 8% of the net cost; quantity >50 then discount =12%of the netcost). Apply discount afterthe net cost has been calculated.
d. The tax ona purchase is calculated by the following formula: purchase_tax=(net_cost * tax_nate/100 (drop/100 if you converted the rate from a percentage)
e. The total cost of a purchase (rounded to the nearest hundredth) is calculated by the following formula: .total_cost=net_cost+purchase_tax - discount. Note: All tax and cost calculations should be rounded to the nearest hundredths.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:20
Which of these is a benefit of social networking? oa. hiding your true identity from friendsob. avoiding talking to people in personoc. spending time with friends instead of studyingod. connecting with new people
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
Technician a says that with self-adjusting clutch systems, the release bearing constantly rotates. technician b says that the ball bearing portion of the release bearing should be lubricated with high-temperature grease during routine maintenance. which technician is correct?
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 2
You know the right answer?
In this assignment you will implement a program called nursery_inv3.cpp to process the customer purc...
Questions
question
Mathematics, 27.09.2019 22:30
Questions on the website: 13722360