Jason 16

05-19-2009, 07:56 PM

mis type no s on forums

I was given this and told to find the errors and I cant for the life of me I know its a small one and its in pascal. could you guys help me out. Its a simple program that takes number grades and make them letter grades I just dont know where the last error is Ive all ready found 4 of the five.:unsure-1:

Program LetterGradeConversion;

var {Global Variable List}

Grade:Real;

LetterGrade:Char;

{-----------GetNumerialcGrade-------------------------}

procedure GetNumberGrade(var grade:real);

begin

write('Please enter a grade:');

readln(Grade);

end;

{------------CalculateLetterGrade--------------------}

Procedure CalculateLetterGrade (var Grade:real; letter Grade:char);

begin

if Grade>= 92.5 then letter grade:='A';

If(Grade >=83.5) and (Grade<92.5) then Lettergrade:='B';

If(Grade >=71.5) and (Grade<83.5) then Lettergrade:='C';

If(Grade >=59.5) and (Grade<71.5) then Lettergrade:='D';

if Grade<= 59.5 then letter grade:='F';

end;

{-------EchoDataAndPrintConversionResults---------------}

Procedure EchoDataAndPrintconversionresults(var LetterGrade:char);

begin

writeln('Agrade of ',Grade:0:0,'is a ', lettergrade);

end;

{-----------------Main------------------}

begin

GetNumberGrade(Grade);

CalculateLetterGrade(Grade,LetterGrade);

EchoDataAndPrintConversionResults(LetterGrade);

end.

I was given this and told to find the errors and I cant for the life of me I know its a small one and its in pascal. could you guys help me out. Its a simple program that takes number grades and make them letter grades I just dont know where the last error is Ive all ready found 4 of the five.:unsure-1:

Program LetterGradeConversion;

var {Global Variable List}

Grade:Real;

LetterGrade:Char;

{-----------GetNumerialcGrade-------------------------}

procedure GetNumberGrade(var grade:real);

begin

write('Please enter a grade:');

readln(Grade);

end;

{------------CalculateLetterGrade--------------------}

Procedure CalculateLetterGrade (var Grade:real; letter Grade:char);

begin

if Grade>= 92.5 then letter grade:='A';

If(Grade >=83.5) and (Grade<92.5) then Lettergrade:='B';

If(Grade >=71.5) and (Grade<83.5) then Lettergrade:='C';

If(Grade >=59.5) and (Grade<71.5) then Lettergrade:='D';

if Grade<= 59.5 then letter grade:='F';

end;

{-------EchoDataAndPrintConversionResults---------------}

Procedure EchoDataAndPrintconversionresults(var LetterGrade:char);

begin

writeln('Agrade of ',Grade:0:0,'is a ', lettergrade);

end;

{-----------------Main------------------}

begin

GetNumberGrade(Grade);

CalculateLetterGrade(Grade,LetterGrade);

EchoDataAndPrintConversionResults(LetterGrade);

end.