Prepare the logic for a program that continuously prompts


Problem

Create the logic for a program that continuously prompts the user for two numeric values that represent the sides of a rectangle. Include two overloaded methods that compute a rectangle's area. One method takes two numeric parameters and calculates the area by multiplying the parameters. The other takes a single numeric parameter, which is squared to calculate area. Each method displays its calculated result. Accept input and respond as follows:

• When the user enters a negative number for the first value, end the program.

• If the user enters a negative number for the second value, continue to the user until the second value is not negative.

• If both numbers entered are greater than 0, call the method version that accepts two parameters and pass it both values.

• If one of the values entered is 0 but the other is not, call the version of the method that accepts just one parameter and pass it the nonzero value.

• If both the entered values are 0, display an error message.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Prepare the logic for a program that continuously prompts
Reference No:- TGS02648642

Expected delivery within 24 Hours