Write a c++ program that reads upto 50 student names,grades, and average then prints the number of pass and fail students . Remarks : Passing grade is 60?
using namespace std; //main function int main(int argc, char *argv[]) { string names[50];//variable array for names int grades[50];//variable array for grades double average[50];//variable array for average for(int i=0;i<50;i++){ //promt user to enter name cout<<"Enter name: "; cin>>names[i]; //promt user to enter grade cout<<"Enter grade: "; cin>>grades[i]; //promt user to enter average cout<<"Enter average: "; cin>>average[i]; } //show result for(int i=0;i<50;i++){ if(grades[i]<60){ cout<<"Student "<<names[i]<<" failed\n"; }else{ cout<<"Student "<<names[i]<<" passed\n"; } }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment