Create a program that calculates your daily driving cost, so that you can estimate how much money could be saved by carpooling (car-sharing), which also has other advantages such as reducing carbon emissions and reducing traffic congestion. The program should input the following information and display the user’s cost per day of driving to work:
a) Total miles driven per day.
b) Cost per gallon of gasoline.
c) Average miles per gallon.
d) Parking fees per day.
#include<iostream>
using namespace std;
void SHOW(){
cout<<"TOTAL MILES"<<endl;
int miles;
cin>>miles;
cout<<"enter fuel IN GALOSINE"<<endl;
int fuel;
cin>>fuel;
cout<<"PUTparking fee"<<endl;
double fees;
cin>>fees;
cout<<"Average miles per gallion IS "<<miles/fuel<<endl;
cout<<"total cost per day "<<miles*fuel+fees<<endl;
}
int main(){
SHOW();
return 0;}
Comments
Leave a comment