Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write Pseudocode for the following: Develop a menu-driven program that inputs a

ID: 3539938 • Letter: W

Question

Write Pseudocode for the following:

Develop a menu-driven program that inputs a number X, and at the user's option, finds and displays the area (A) of one of the following:
* A square with side X, A = x^2
* A circle with radius X, A = 3.14 * X^2
* An equilateral triangle with side X, A = Sqrt (3) / 4 * X^2

Explanation / Answer

X = > 0 or < 4 Choice = INT Call WelcomeMessage Call InputData (X) Call InputChoice(Choice) Select Case Of Choice Case: 1 Call Square(X) Case: 2 Call Circle(X) Case: 3 Call Triangle(X) Default: Print "Input not understood. Run the program again." End Case End Program sub WelcomeMessage Print "This program computes areas for a square, circle, or a triangle" Print "based on the users input." End sub function InputData (Float X As Ref) Print "Please input a value:" Input X End sub sub InputChoice (Integer Choice As Ref) Print "Enter 1 to compute the area of a square with side, X" Print "Enter 2 to compute the area of a circle with radius, X" Print "Enter 3 to compute the area of an equilateral triangle with side, X" Input Choice End sub sub Square (Float X) Declare A As Float Square = X^2 print "The area of the square is:" print Square End sub sub Circle (Float X) Declare A As Float Circle = 3.14 * X^2 print "The area of the circle is:" Print Circle End sub sub Triangle (Float X) Declare A As Float Triangle = Sqrt (3/4) * X^2 Print "The area of the triangle is:" Print A End sub
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote