98 713
Assignments Done
98.6%
Successfully Done
In April 2021

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 &lt;&lt;&quot;Enter mileage for November&quot;&lt;&lt;i&lt;&lt;&quot;:&quot;; cin&gt;&gt;mileage; totalMileage=mileage; highestMileage=mileage; for(...;...;...)$
{
cout &lt;&lt;&quot;Enter mileage for November&quot;&lt;&lt;i&lt;&lt;&quot;:&quot;;
cin&gt;&gt;mileage;
if(...&gt;highestMileage)${ day=...$
highestMileage=mileage;
}
totalMileage=...$} cout&lt;&lt;&quot;Total Mileage for November:&quot;&lt;&lt;totalMileage&lt;&lt;endl; cout&lt;&lt;&quot;Highest Mileage was&quot;&lt;&lt;highestMileage&lt;&lt;&quot;on&quot;&lt;&lt;day&lt;&lt;&quot;of November&quot;&lt;&lt;endl; return 0; } 1 Expert's answer 2012-03-30T09:24:41-0400 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!