Question: Create a program that compares the unit prices for two sizes of laundry detergent sold at a grocery store. Console Price Comparison Price of 64
Create a program that compares the unit prices for two sizes of laundry detergent sold at a grocery store.
Console
Price Comparison
Price of 64 ounce size: 5.99
Price of 32 ounce size: 3.50
Price per ounce (64 oz): 0.09
Price per ounce (32 oz): 0.11
Specifications
- The formula for calculating price per ounce is:
price per ounce = price / ounces
- The number of ounces for the comparison should be 64 and 32, but the code should store this data in two variables. That way, you can easily change the number of ounces for each comparison later, just by changing the value thats stored in each variable.
- The program should round the results to a maximum of two decimal places.
- Assume the user will enter valid data.
- I need it in C++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
