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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:30, AsiaDeas4078
Write lines of verse that rhyme to remember the following information: acid rain is a type of air pollution caused by chemicals in the air.
Answers: 1
image
Computers and Technology, 23.06.2019 09:20, lovely222
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
image
Computers and Technology, 23.06.2019 20:10, banna01man
Leo is a recruitment executive for a large company. he has identified new labor resource requirements in both the marketing and production departments. what should be his first step in recruiting candidates for the positions? a. conduct background checks of candidates b. make job offers c. arrange interviews d. conduct reference checks e. place job ads on job sites
Answers: 1
image
Computers and Technology, 24.06.2019 06:30, chloeholt123
For which utilities, if any, does the landlord pay?
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 in other subjects:

Konu
Mathematics, 08.01.2021 14:00