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 WLA 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:
CS WWLA abc FirstName LastName
What's the height of the rectangle?
What's the width of the rectangle?
What do you want to calculate? aarea, pperimeter a
The area of the rectangle is:
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 the last line would show "The perimeter of the rectangle is:
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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
