Problem

Create the logic for a program that continuously prompts the user for two numeric values t...

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 reprompt the user until the second value is not negative.

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

• 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 boththe entered values are 0, display an error message.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT