Pascal number to alphabet score convert

In this article let’s discuss about Pascal number to alphabet score convert. Let’s go through the following simple program without any delay 🙂

program number_to_alphabet_score;

var
    score : Integer;
    alphabet_score : string;

function convert(score : Integer) : string;
begin
   if (score >=80) and (score <=100) then
      alphabet_score := 'A'
   else if (score >=70) and (score <80) then
      alphabet_score := 'B'
   else if (score >=55) and (score <70) then
      alphabet_score := 'C'
   else if (score >=40) and (score <55) then
      alphabet_score := 'D'
   else if (score >0) and (score <40) then
      alphabet_score := 'E'
end;

begin
  Write('Your score : ');ReadLn(score);
  convert(score);
  WriteLn('Your score is ', alphabet_score)
end.

Input : Your score : 75

Output : Your score is B

Hope the above methods works for you. Happy Learning and get back to us Anytime.

Realted Posts : Ackermann function pascal