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

Create the logic for a program that continuously prompts a user for a numeric va

ID: 3634362 • Letter: C

Question

Create the logic for a program that continuously prompts a user for a numeric value until the user enters 0. The application passes the value in turn to a method that squares the number and to a method that cubes the number. The program displays the results before reprompting the user. Create the two methods that square and cube a number passed to them and then return the calculated value.
1. A hierarchy chart showing all modules by name and parameters.
2. Pseudocode for each module.

Explanation / Answer

START declare side1 as double declare side2 as double While true Display "Enter side 1: " Input side1 if side1 < 0 Exit End if Do Display "Enter side 2(>0): " Input side2 While side20 And side2 >0 Call calculateArea(side1,side2) Else if side1 = 0 And side2 >0 Call calculateArea(side2) Else if side2 = 0 And side1 >0 Call calculateArea(side1) Else if side2 = 0 And side1 = 0 Display "Error! Can't calulare area when both sides are 0" End if End While STOP
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