• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 365
  • Last Modified:

Writing C++ Programs

Write a program to calculate the number of miles a vehicle can be driven, given the gallon capacity and miles per gallon the vehicle gets. Written in program
1 Solution
This is insanely easy....

#include <iostream>

using namespace std;

int main(){
double tankSize, MPG;
cout << "Enter the size of the gas tank of the car in gallons: ";
cin >> tankSize;

cout <<"\nEnter the MPG of the vehicle: ";
cin >> MPG;

cout <<"\nThe total number of miles you can drive without refueling is: " << tankSize*MPG <<endl<<endl;

return 0;
TammariaAuthor Commented:
Thank you so much. I am just learning and need a little help to get started.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now