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 10:30
Aconstruction company is creating a powerpoint presentation describing how they calculate costs during each construction step. they plan to email this presentation to clients. the individual clients will be watching the presentation slide show on their own personal computers. what is the most important formatting step the company should take to make the text readable and pleasing to the eye?
Answers: 2
question
Computers and Technology, 22.06.2019 15:10
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
question
Computers and Technology, 22.06.2019 15:20
The north and south regions had very diferent economies in the 1800s.
Answers: 1
question
Computers and Technology, 22.06.2019 18:40
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
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, 11.04.2020 06:38
question
Mathematics, 11.04.2020 06:38
question
Physics, 11.04.2020 06:39
question
Mathematics, 11.04.2020 06:39
question
Biology, 11.04.2020 06:40
question
Mathematics, 11.04.2020 06:40
Questions on the website: 13722360