Write an interactive program (algorithm and flowcharthat computes the area of rectangle ( area = base* height) and area of triangle ( area = 1 * base* height). Let the user choose what area to compute by prompting the first character of figure name (R-Rectangle or T - Triangle) then compute and print the desired result.
input:
b \\ base
h \\ height
S \\ area
enter R or T
if R then
S=b*h
else if T then
S=0.5*b*h
output:
print S
Comments
Leave a comment