Assignment3

Assignment3 - if(Name =="FINISHED" break...

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

View Full Document Right Arrow Icon
Sheet1 // This program prompts for, reads and sums a list of // scores of type float until a negative number or // a score greater than 100. Print the sum and average // of the scores entered. #include <iomanip> #include <iostream> #include <string> using namespace std int main() { string First_Name, Last_Name Grade double TotalScore, Score int NumberofTests cout << "Ultra Super Very Famous Grade Calculator " << endl cout << "This program will process test scores to provide individuals with a letter " << endl cout << "grade report according to the following scale: " << endl cout << " 90 < average <= 100 A" << endl cout << " 80 < average <= 90 B" << endl cout << " 67.5 < average <= 80 C" << endl cout << " 55 < average <= 67.5 D" << endl cout << " 0 <= average <= 55 F" << endl while (true) { cout << "Please enter the first and last name of the student (type FINISHED to end program)" << endl getline(cin, First_Name) getline(cin, Last_Name)
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
Background image of page 3

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

View Full Document Right Arrow Icon
Background image of page 4
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if (Name == "FINISHED") break cout << "Please enter the score (enter a negative number to terminate)" << endl TotalScore = 0 Score = 0 NumberofTests = 0 w while (true) { cin >> Score if (Score < 0) cout << "Invalid Score was input, no calculations were made" break NumberofTests++ Page 1 Sheet1 NumberofTests = NumberofTests + Score } if (Score > 90) Grade = "A" else if (Score > 80) Grade = "B" else if (Score > 67.5) Grade = "C" else if (Score > 55) Grade = "D" else G Grade = "F" cout << "The following grade report was generated for " << First_Name << Last_Name << endl cout << "The calculated average for " << NumberofTests << " tests is " << TotalScore / NumberofTests << endl c cout << "The grade attained is: " << Grade << endl } cout << "The report has been completed, thanks for using my grade calculator and have a nice day" << endl return 0 } Page 2 Sheet1 Page 3 Sheet1 Page 4...
View Full Document

{[ snackBarMessage ]}

Page1 / 5

Assignment3 - if(Name =="FINISHED" break...

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

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