program AreaofRectangleOrTriangle;
uses
WinCrt;
var
Base, Height, RectOrTrian,
Area, CharUserInput: Char;
Begin
(*Enter R or T*);
Writeln('Enter R for Rectangle or T for Triangle');
Readln(CharUserInput);
(*Enter Base and Height*);
Writeln('Enter Base ');
Readln(Base);
Writeln('Enter Height ');
Readln(Height);
(*Give case statement and formulas*);
if (CharUserInput = 'R') or (CharUserInput = 'r') then
Area := Base * Height
else if (CharUserInput = 'T') or (CharUserInput = 't') then
Area := .5 * Base * Height;
(*Print to screen*);
Writeln('Area is ');
End.
It keeps stopping on the else statement...and I cannot for the life of me figure it out...can someone tell me how to do this?
thanks