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 06:00
Pthe price of tickets in a group when a purchased in bulk can be found with the equation c=px+24 were c is the cost, p is the number of people,and x is the price per ticket. what is price of of each ticket if it costs $189 to buy tickets for 15 people ? a $8 b $24c $9d $11 show work
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
Which statistical function in a spreadsheet you to see how far each number varies, on average, from the average value of the list?
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
How to do this programming flowchart?
Answers: 3
question
Computers and Technology, 24.06.2019 17:50
Which of the following best describe how the depth-limited search works. a normal depth-first search is performed but the number of ply/depths is limited. a normal breadth-first search is performed but the number of ply/depths is limited. a normal breadth-first search is performed but values above a specific value will be ignored. a normal depth-first search is performed but values above a specific value will be ignored.
Answers: 1
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, 25.08.2019 22:30
question
Mathematics, 25.08.2019 22:30
question
Engineering, 25.08.2019 22:30
Questions on the website: 13722360