The purpose of this lab is to write a program to calculate a car's fuel economy based on the number of miles driven and the number of gallons of fuel used.
If you have a solution open in Visual Studio, close it (File->Close Solution).
Download CS200_Lab7.zip. Import it into Visual Studio (File->Import...).
Add your code to the source file called MilesPerGallon.c.
Your task is to write a program that will prompt the user for two quantities. First, the number of miles driven. Second, the number of gallons of fuel used.
After reading these two quantities into variables, you should compute the fuel economy in miles per gallon. Your program should display one digit to the right of the decimal point.
Here is an example run of the program. User input is shown in bold.
Miles driven: 400Gallons of fuel used: 14.7Fuel economy was 27.2 miles per gallon
The number of miles driven an number of gallons of fuel used are not necessarily whole numbers. Your program should handle fractional values.
The fuel economy will not necessarily be a whole number.
In Visual Studio, press "Control-F5" to compile and run your program.
When you are done, choose Tools->Submit to submit your completed lab to the server. You will need to enter your Marmoset username and password.
If the Tools->Submit option does not work, create a zip file containing the files in your project, and upload it to the submission server as lab7. The server URL is