Computer Science, asked by Koley, 1 year ago

write a program in Q Basic using select case to find the area of a scalene triangle circle and rectangle ​

Answers

Answered by Sukhpreet85
0

CLS

REM TO LEARN CODING

PRINT "--Menu--"

PRINT "SELECT ANY ONE OF THE FOLLOWING:"

PRINT "C FOR CIRCLE"

PRINT "R FOR RECTANGLE"

PRINT "T FOR TRIANGLE"

K$=""

DO

K$=UCASE$(INKEY$)

LOOP UNTIL K$<>""

IF K$="C" THEN

'User has opted for Circle

INPUT "Enter the radius of Circle : ";RADIUS

AREA=(22/7)*RADIUS*RADIUS

PRINT "Area of the Circle : ";AREA

ELSEIF K$="R" THEN

'User has opted for Rectangle

INPUT "Enter the Length of the Rectangle : ";L

INPUT "Enter the Breadth of the Rectangle : ";R

A=L*B

PRINT "Area of the Rectangle : ";A

ELSEIF K$="T" THEN

'User has opted for Trinagle

INPUT "Enter the Base of the Triangle : ";B

INPUT "Enter the Height of the Triangle : ";H

A2=(1/2)*B*H

PRINT "Area of the Triangle : ";A2

ELSE

PRINT "INVALID INPUT!!!"

END IF


Koley: I told area of a scalene triangle not only triangle
Similar questions