Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i am learning c++ and i was hoping you could help me out with this problem. Write a program that requests a weight number in

i am learning c++ and i was hoping you could help me out with this problem.

Write a program that requests a weight number in ounces (oz).

Write a function that converts the weight to pounds (lb) and grams (g). a) Main should handle all input and output. (This requires that variables in main are updated by the function.)

b) Exit program if and only if the sentinel value (zero) is entered.

c) Secondary function should only handle calculations. Output Example: Enter the weight of your item in ounces (oz) or enter zero to end the program: -1 Please enter a positive value. Try again. Enter the weight of your item in ounces (oz) or enter zero to end the program: 32.32 32.32 oz = 2.02 lb 32.32 oz = 916.26 g Enter the weight of your item in ounces (oz) or enter zero to end the program: 0 Exit program. Good bye!

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

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions