#include<iostream>
usingnamespace std;
int nain(int,char**) {
do
{
int miles,daysweek,weakyear,milage,milesperyear,gallonsperyear,gasmoneyperyear;
double calculation=0,commute=0,gasprice,gasexpense;
cout<<"How many round-trip miles a day do you commute"<<endl;
cin>>miles;
cout<<"How many days a week do you commute?"<<endl;
cin>>daysweek;
cout<<"How many weeks a year do you commute?"<<endl;
cin>>weakyear;
cout<<"How many miles per gallon does your vehicle get? "<<endl;
cin>>milage;
cout<<" What is the current per gallon price of gas?"<<endl;
cin>>gasprice;
milesperyear=miles*daysweek*weakyear;
gallonsperyear=milesperyear/milage;
gasmoneyperyear=gallonsperyear*gasprice;
gasexpense=gasmoneyperyear/12;
cout<<miles<<" miles a day "<<endl;
cout<<daysweek<<" days a week "<<endl;
cout<<weakyear<<" week a year"<<endl;
cout<<milage<<"miles per gallon"<<endl;
cout<<gasprice<<" dollars per gallon"<<endl;
cout<<"monthly gas expense: $ "<<gasexpense;
char anws;
cout<<"Would you like to another cost of commute calculation Press 'Y' or 'y' for another calculation"
cin>>anws;
calculation=calculation+1;
costtotal=costtotal+gasexpense;
}
while(anws=='Y || anws=='y');
cout<<"This program executed"<<calculation<<"cost of commute calculations."<<endl;
cout<<"Total commute miles"<< commute <<endl;
cout<<"Average commute cost: $"<< costtotal;
system("pause");
return 0 ;
}