Question: PreLab03: Write a Java program called PreLab03 that prompts your daughter to enter the problem number. If an even integer is entered, then your

PreLab03: Write a Java program called PreLab03 that prompts your daughter to enter the problem number. If an even integer is entered, then your program should calculate the area of a circle. You will need to prompt her for the radius of the circle. If an odd integer is entered, then your program should calculate the area of a rectangle. You will need to prompt her for the length and width of the rectangle. Use selection statements to code this. width length Area length *width radius Area = * 12 Declare the "probnum" variable as a byte data type, the "length, width, and radius" variables should be double data types. Use the logical "Or" operator to validate the range of the probnum variable. If it is outside the range 1-10, you can issue a "return;" statement to end the program. Your output should be formatted identical to the sample runs below. Be sure to include a program header block similar to the one below: * Program Name: * Program Description: + * Program Author: PreLab03 This program helps my daughter check her math homework Date Created: + * Change* Patrick J Cassidy 09/18/2020 Change Date Programmer Name Description Some sample runs: run: Enter your problem number: 1 Rectangle Enter length: 10 Enter width: 20 Area 200.0 BUILD SUCCESSFUL (total time: 4 seconds) run: Enter your problem number: 2 Circle Enter radius: 10 Area 314.159 BUILD SUCCESSFUL (total time: 3 seconds) run: Enter your problem number: 11 Problem number outside range. Program ending. BUILD SUCCESSFUL (total time: 1 second)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
