Question: 2.7.2: Floating-point numbers (double). Complete the code to output The weight in pounds is weightOunces / 16. On the next line, output the value of

2.7.2: Floating-point numbers (double).

Complete the code to output "The weight in pounds is weightOunces / 16". On the next line, output the value of weightOunces to one digit after the decimal point, followed by " ounces = ", and then the value of weightPounds to five digits after the decimal point, and lastly " pounds". End with a newline.

Ex: If the input is 2.0, then the output is:

The weight in pounds is weightOunces / 16 2.0 ounces = 0.12500 pounds

HOW DO I GET THE CORRECT INPUT?

2.7.2: Floating-point numbers (double). Complete the code to output "The weight in

Ex: If the input is 2.0, then the output is: The weight in pounds is weightounces / 16 2.0 ounces =0.12500 pounds 1 2 If input is 2.0, then 2.0 ounces is 16.02.0=0.12500 pounds. Ounces is to one decimal point, and pounds is to five decimal points. Thus, the output is: The weight in pounds is weightounces / 16 2.0 ounces =0.12500 pounds Not all tests passed. X 1: Compare output Output differs. See highlights below. Input Your output. Expectedoutput2.0TheweightinpoundsisweightOunces/160.12500pounds

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!