-Inventory given through picture -Language from C++03 The fill will have the following specifications: Each record consists of two lines. The first line contains the name of the product, which may be more than one word long. The second line contains the wholesale price as a decimal, the markup as a percentage, and three quantities, for counter, shelf, and warehouse. If the first line of a record contains the word END all by itself, that is the end of the file. Your task is to read each record into the program, as a string for the name, and numbers for the price and markup, and as an array of numbers for the quantities. Then calculate the total profit for each item: (wholesale price) * (markup, converted into a decimal) * (total quantity). Print out a report on one line for each item: Name, total profit. Format the output nicely: names should fit in 30 characters and the prices should line up and should have two decimal places. Hints: You’ll want to use getline to read multi-word product names. You’ll want to consider what kind of array to use for quantities – do you have fractional quantities or whole numbers?
-Inventory given through picture
-Language from C++03
The fill will have the following specifications:
Each record consists of two lines.
The first line contains the name of the product, which may be more than one word long.
The second line contains the wholesale price as a decimal, the markup as a percentage, and three quantities, for counter, shelf, and warehouse.
If the first line of a record contains the word END all by itself, that is the end of the file.
Your task is to read each record into the program, as a string for the name, and numbers for the price and markup, and as an array of numbers for the quantities.
Then calculate the total profit for each item: (wholesale price) * (markup, converted into a decimal) * (total quantity).
Print out a report on one line for each item: Name, total profit.
Format the output nicely: names should fit in 30 characters and the prices should line up and should have two decimal places.
Hints:
You’ll want to use getline to read multi-word product names.
You’ll want to consider what kind of array to use for quantities – do you have fractional quantities or whole numbers?
Step by step
Solved in 3 steps with 1 images