89 163
Assignments Done
98.1%
Successfully Done
In July 2020

Question #19049
this program accept the following:
1. 5 type of car (a,b,c,d,f)
2.for each it accept the length of the car in centimeter
3.the length of the road in kilometer
4.the number of the lanes in the road
5.if the road is double-side or not

the program then calculates that how many of cars can fit on the road. the program assume 2 meters distance between each tow consecutive cars. the program also assume that there would be exactly 20% of each ace type on the road
1
2012-11-20T08:10:46-0500
# include <iostream>

using namespace std;

int main(){
int car[5];
int num;
bool size;
char c;
for(int i=0;i<5;i++){
cout<<"Enter size of car "<<i<<endl;
cin>>car[i];}

cout<<"Enter num of lanes "<<endl;
cin>>num;
cin>>c;
if ((c=='y')||(c=='Y')) {size=1; num*=2;}
else size=0;

& cout<<"MAX amount of each car is "<<am<<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!