hello. I've got an assignment on my yesterday class. i need to make a program that reads characters and if they are (1,2,3,4), the program will show (a,b,c,d) respectively. the teacher specified that it need to be done using a function. when i "finished", the compiler gave me an error because it was a semicolon missed before the end of the program, but no matter how much i try to fix it, it keeps giving that error. i would appreciate if you guys could help me. my code until now is:
program funcion;
uses crt;
var num: char;
Function search(a:char): char;
Begin
case a of '1':
search:='a';
'2':
search:='b';
'3':
search:='c';
end;
begin
writeln ('type in a character');
readln (num);
writeln (search(num));
end.
i would appreciate any help with the code. (sorry for my grammar, my mother language is Spanish).