Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

4. What will the team agreement contain?

Answered: 1 week ago