c++ - categoriesofgrade - #include using...

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

View Full Document Right Arrow Icon
#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;
Image of page 1

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

View Full Document Right Arrow Icon
cout<<"Total Satisfactories : "<<totals<<endl; cout<<"Total Unsatisfactories: "<<totalu<<endl; return 0; } /* TEST CASE 1 CATEGORY OF NUMERICAL GRADES...
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern