60 429
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #46560 in C++ for Lei Reyes

Question #46560
Write a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles per gallons the automobile can be driven. The program outputs the number of miles the automobile can be driven without refuelling.
Expert's answer
#include <stdlib.h>
#include <iostream>  // for cout and cin
#include <stdio.h>
#include <cstdlib>   // for system
using namespace std;
int main()
{
    int fuelTank;
int milesPerGallons;
cout<<"Enter the capacity, in gallons, of an automobile fuel tank : ";
cin>>fuelTank;
cout<<"Enter the miles per gallons the automobile can be driven : ";
cin>>milesPerGallons;
cout<<"Automobile can be driven without refuelling "<<fuelTank * milesPerGallons<<" miles."<<endl;
system("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions