Assignment3

Assignment3 - if (Name ==...

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

Page1 / 5

Assignment3 - if (Name ==...

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