← Back to User Input
Question 192
Fuel Cost For A Trip
Fuel Cost For A Trip
Read a trip distance in kilometres, a fuel economy in litres per 100 km and a fuel price per litre, all decimal numbers, then print two lines: Litres: <value> with one decimal, where the litres are the distance divided by 100 times the economy, and Cost: <value> with two decimals, the litres times the price. Input: three lines in that order, no prompts.
Expected Output:
Litres: 32.0 Cost: 48.00
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
User Input
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.