Answer to Question #12883 in C++ for shalennee

Question #12883
International Book Fair which was held for 30 days attracted many visitors. Only those visitors with passes were allowed to enter. Number of passes issued for each day was recorded.
(a) Calculates the total visitors who went to the book fair.
(b) Calculates the average number of visitors.
(c) Calculates the number of days which has the number of visitors more than 50.
1
Expert's answer
2012-08-10T09:49:39-0400
int visitors[30];
int ave=0;
int days=0;
for (int i=0;
i<30; i++){
cout<<"Enter the number of visitors on day
"<< i+1<<endl;
cin>>visitors[i];

ave=ave+visitors[i];
if (visitors[i]>50){

days=days+1;
}
}
ave=ave/30;
cout<<"Average
number of visitors "<<ave<<endl;
cout<<"Number of days
with more than 50 visitors "<<days<<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 the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS