Download presentation
Presentation is loading. Please wait.
2
1 Lab Assignment#5 Due 12/7 A car can hold 12 gallons of gasoline and it can travel 360 miles without refuelling. Write a program the displays the trip meter of the car followed by amount of fuel left. Every time the user enters letter ‘r’, 10 miles are added to the trip meter and appropriate amount of fuel is deducted. As the amount of fuel becomes 1 gallon, the program prints a warning.
3
2 Sample Output s Miles so far: 160 Fuel left: 6.66667 s r Miles so far: 170 Fuel left: 6.33333 r Miles so far: 180 Fuel left: 6
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.