/*Date: 02/04/08 Programming Fundamentals II Homework Assignment Chapter 3-Question #3.4 Miles per Gallon - Write a program that calculates a car's gas mileage. The program should ask the user to enter the number of gallons of gas the car can hold and the number of miles it can be driven on a full tank. It should then calculate and display the number of miles per gallon the car gets */ #include using namespace std; int main() { double gallons, miles, mpg;//creates double variables for gallons,miles, * mpg cout <<"Welcome to Miles per Gallon Version 1.\n";//welcomes user cout <<"Please enter the number of gallons your car can hold.\n";//asks for input cin >> gallons;//stores input from user in gallons cout <<"Please enter the number of mile(s) you can drive on a full tank.\n";//asks for input cin >> miles;//stores input from user in miles mpg = miles / gallons; //divides miles by gallons and stores in mpg cout <<"Your car gets " << mpg << " miles to the gallon.\n";//prints mpg to screen cout <<"Thank you for using our program.\n";//thanks user for using program return 0;//returns int of 0 for main() to end program }