64 648
Assignments Done
99,2%
Successfully Done
In September 2018

Answer to Question #4324 in C++ for nadelta

Question #4324
Thembi is concerned about her mileage on her new car.so she keeps a record of kilometres driven for the month of Novembe.The program below calculates her mileage for the month of November and the day on which her mileage was the maximum.Complete the lines of code where $ indicated.

float mileage;
float highestMileage;
float totalMileage;
int i=1;
int day=1;

cout <<"Enter mileage for November"<<i<<":";
cin>>mileage;

totalMileage=mileage;
highestMileage=mileage;
for(...;...;...)$
{
cout <<"Enter mileage for November"<<i<<":";
cin>>mileage;
if(...>highestMileage)$
{
day=...$
highestMileage=mileage;
}
totalMileage=...$
}
cout<<"Total Mileage for November:"<<totalMileage<<endl;
cout<<"Highest Mileage was"<<highestMileage<<"on"<<day<<"of November"<<endl;
return 0;
}
Expert's answer

float mileage;
float highestMileage;
float totalMileage;
int i=1;
int day=1;
&
cout <<"Enter mileage for November"<<i<<":"; cin="">>mileage;
&
totalMileage=mileage;
highestMileage=mileage;
for(...;...;...)$
{
cout <<"Enter mileage for November"<<i<<":"; cin="">>mileage;
if(...>highestMileage)$
{
& day=...$
& highestMileage=mileage;
}
totalMileage=...$
}
cout<<"Total Mileage for November:"<<totalmileage<<endl; cout<<"highest="" mileage="" was"<<highestmileage<<"on"<<day<<"of="" november"<<endl;="" return="" 0;="" }<="" span=""></totalmileage<<endl;></i<<":";></i<<":";>




float mileage;
float highestMileage;
float totalMileage;
int i=1;
int day=1;

void main(){
&
cout <<"Enter mileage for November "<<i<<":";
cin >>mileage;
&
totalMileage=mileage;
highestMileage=mileage;

for(i=2;i<=5;i++){
& cout <<"Enter mileage for November "<<i<<":";
& cin>>mileage;
if(mileage>highestMileage){
& day=i;
& highestMileage=mileage;
}
totalMileage += mileage;
}
cout<<"Total Mileage for November:"<<totalMileage<<endl;
cout<<"highest mileage was "<<highestMileage<<" on "<<day<<" of november."<<endl;

}

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