It keeps failing at the else statement?


program AreaofRectangleOrTriangle;

uses
WinCrt;

var

Base, Height, 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 (CharUserInput = 'T') or (CharUserInput = 't') then
Area := .5 * Base * Height;
(*Print to screen*);
Writeln('Area is ');


End.

Nice to meet you.

Maybe you meant 'else if'? This is not the right forum for your question.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.