60 627
Assignments Done
97,8%
Successfully Done
In April 2018

Answer to Question #13289 in C++ for mark

Question #13289
write a c++ program that would input 10 grades and output the total passed and total failed.
Expert's answer
#include "stdafx.h"
#include <iostream>
#include <conio.h>
#include <string>

using namespace std;

int main()
{
int grades[10];
int totalPassed=0;
int totalfailed=0;
for(int i=0;i<10;i++){
cout<<"Enter grade "<<(i+1)<<": 3";
cin>>grades[i];
}
for(int i=0;i<10;i++){
if(grades[i]>=60){
totalPassed++;
cout<<"Grade "<<(i+1)<<" is passed
";
}else{
cout<<"Grade "<<(i+1)<<" is
failed
";
totalfailed++;
}
}
cout<<"Total passed are: "<<totalPassed<<"
";
cout<<"Total failed are: "<<totalfailed<<"
";
getch();
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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions