Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1: Find the Maximum and Minimum Weights You have weight data for several items. Those weights are in pounds and ounces, which are both

Part 1: Find the Maximum and Minimum Weights

You have weight data for several items. Those weights are in pounds and ounces, which are both integer values, like table below.

item weight
item1 1lb 5oz
item2 32oz
item3 5lb 20oz

Write a program that will read in the weight of an item in pounds and ounces one by one. Each time after user inputs a weight, the program asks user to input [Y/N] whether user wants to input more weight data. When user say 'N', the program prints the maximum and the minimum weights among the weight data.

  • Divide this task into several subtasks. Some of subtasks may be divided into a few sub-subtask. State those in comment lines in your code.
  • The program should not assume the number of weight data.
    • Include a loop that lets the user repeat new input values until the user wants to end the program.
    • When user wishes to end the program, the program outputs the maximum and minimum of weight data, and then ends.
  • Even though user inputs ounces that is greater than or equal to 16, the program should convert it to pounds and ounces that is less than 16.
    • For example, 32oz is converted to 2lb 0oz, Note 16 oz = 1 lb.
  • Declare variables to express all constant values used in the code with the modifier const. And use those in your code.
  • Use an appropriate data type for each variable declared in your code.
  • State your name in a comment line.
  • in C++ coding

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899