Created
March 17, 2022 12:09
-
-
Save marklocklear/546fe5d518c4b24684ed6fe980d6164e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Miles Per Gallon App | |
//Mark Locklear | |
#include <iostream> | |
using namespace std; | |
int main() { | |
string make_model; | |
int miles; | |
int gallons; | |
int mpg; | |
//get input | |
cout << "Model Car:"; | |
cin >> make_model; | |
cout << "Miles Driven:"; | |
cin >> miles; | |
cout << "Gallons used:"; | |
cin >> gallons; | |
//calculate mpg | |
mpg = miles/gallons; | |
//output result | |
cout << "Your MPG is: " << mpg; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment