c++ - categoriesofgrade

c++ - categoriesofgrade - #include<iostream> using...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: #include<iostream> using namespace std; int main() { int count, count2, numGrades, grade, totalo = 0, totals = 0, totalu = 0; double sum = 0, average = 0; char o = 1, s = 1, u = 1; cout<<"CATEGORY OF NUMERICAL GRADES... "<<endl; cout<<"--------------------------------------"<<endl; cout<<"1. 90-100 : OUTSTANDING"<<endl; cout<<"2. 60-89 : SATISFACTORY"<<endl; cout<<"3. 0-59 : UNSATISFACTORY"<<endl<<endl; cout<<"Enter number of grades recieved: "; cin>>numGrades; while(numGrades < 1) { cout<<"[ ERROR. Please enter a number higher than 0 ]: "; cin>>numGrades; } for(count = 1; count <= numGrades; count++) { cout<<count<<". Enter grade: "; cin>>grade; while(grade < 0 || grade > 100) { cout<<"[ ERROR. Please enter a valid grade between 0 to 100. ]: "; cin>>grade; } if(grade >= 90 && grade <= 100) { grade=o; totalo += grade; } else if(grade >= 60 && grade <= 89) { grade=s; totals += grade; } else if(grade >= 0 && grade <= 59) { grade=u; totalu += grade; } } cout<<endl<<endl; cout<<"Overview of grades... "<<endl; cout<<"-----------------------------------------"<<endl; cout<<"Total Outstandings : "<<totalo<<endl; cout<<"Total Satisfactories : "<<totals<<endl; cout<<"Total Unsatisfactories: "<<totalu<<endl; return 0; } /* TEST CASE 1 CATEGORY OF NUMERICAL GRADES...CATEGORY OF NUMERICAL GRADES....
View Full Document

This note was uploaded on 03/18/2008 for the course CMPSC 101 taught by Professor Drobish,renee during the Fall '07 term at Penn State.

Page1 / 5

c++ - categoriesofgrade - #include<iostream> using...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online