Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  grade
Language: PASCAL
Code:
Program grades;

uses crt;

var sum,grade,low,high:integer;avg:real;

BEGIN

sum:=0;
low:=100;
high:=0;

For counter:= 1 to 5;
  Begin
    Write('Please enter grade # ',counter,':  ');
    Readln(grade);
    sum:=sum+grade;
    If grade<low then
      low:=grade;
    If grade>high then
      high:=grade;
  End;

Avg:=sum/counter:0:2;
Writeln('The average grade is ',avg);
writeln;
writeln('The lowest grade is ', low);
writeln;
writeln('The highest grade is ',high);
Readln(grade);

End.     
Comments: