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 04:30
Kyle, a receptionist for a building supply company, recently won an award for saving his company money on their phone system. after being presented with kyle's research, the company changed the way in which it made long-distance phone calls and cut their expenses in this area by 75 percent. the new system the kyle's company most likely adopted was wired communications switching stations voip hdtv
Answers: 3
question
Computers and Technology, 22.06.2019 11:00
The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create the illusion of 3d in a 2d game
Answers: 3
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Jace needs to answer a question on square roots to win a quiz. how can he use a spreadsheet to find the square root of 786? a. use the functions round and count b. create a table and chart c. use the function sqrt d. use the function now
Answers: 3
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.01.2020 18:31
question
Mathematics, 25.01.2020 18:31
question
Mathematics, 25.01.2020 18:31
question
Mathematics, 25.01.2020 18:31