Question: Feedback? CHALLENGE ACTIVITY 2 . 8 . 2 : Floating - point numbers ( double ) . 5 8 2 5 4 8 . 4
Feedback?
CHALLENGE
ACTIVITY
: Floatingpoint numbers double
qxy
Jump to level
One gallon equals fluid ounces. The following program intends to read a floatingpoint value from input, convert the value from fluid ounces to gallons, and output the volume in gallons, but the code contains errors. Find and fix the errors.
Ex: If the input is then the output is:
gallonsInput is a double, but variables volOunces and volGallons are declared as integers. volGallons volounces performs integer division, so results in Therefore, volOunces and volGallons should be doubles.Not all tests passed: Compare outputOutput differs. See highlights below.Input
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
