{ Assignment 3, Program 1 Name: "Exam totaler" By: Ben Weir, CIS 31 Last modified: Sep. 11, 1996 This program gets a user defined number of exam scores and determines if the score is excellent or failing. it then prints a summary of the totals at the end } program Exams; var i, {counter for the FOR-DO loop} numscores, {number of scores to get} score, {the score} total_excels, {total Excellent scores} total_fails: {total Failing scores} integer; {they're all integers} begin write('How many scores do you wish to enter? '); readln(numscores); for i := 1 to numscores do begin repeat {get a score, make sure} write('What is score ',i,'? '); {it's within the proper} readln(score); {range (0 to 100) } until (score >= 0) and (score <= 100); write(score,' '); if score >= 90 then {check if it is an excellent score} begin write('- Excellent'); total_excels :=total_excels + 1; end; {if} if score < 60 then {check if it is a failing score} begin write('- Fail'); total_fails :=total_fails + 1; end; {if} writeln; end; {for} writeln; writeln('-----------------'); writeln('Total Excellents: ',total_excels); {make a final report to} writeln('Total Fails:',total_fails); {the user} writeln('Total exams:',numscores); writeln('-----------------'); writeln('Press enter to continue'); readln; end.