Question: Week 3 - WLA 2 - Program Write a Java program in the textbox below that will calculate either the perimeter or the area of

Week 3-WLA2- Program
Write a Java program in the textbox below that will calculate either the perimeter or the area of a rectangle based on the height and the width input by the user. You can see an example of the program's execution as:
CS1083- W03-WLA02- abc123- FirstName - LastName
What's the height of the rectangle? 5
What's the width of the rectangle? 7
What do you want to calculate? (a-area, p-perimeter) a
The area of the rectangle is: 35.
Replace the values highlighted in yellow with your specifics.
The values highlighted in light blue denote the values input by the user. Note that the values are in the same line where the message requesting the values.
The value in green is based on the calculation.
The colors shown above are for example purposes only.
If the user's input was "48p" the last line would show "The perimeter of the rectangle is: 24".
If the user inputs for the last value was anything different than "a" or "p" the message should be "Wrong option selected.".
You can use the Java Code option or the Courier New font to write your code on the textbox below.
 Week 3-WLA2- Program Write a Java program in the textbox below

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!