Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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?
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.12500poundsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started