Question: Task #3 Switch Statement 1Write a switch statement that compares the user's choice with the appropriate characters (make sure that both capital letters and small

 Task #3 Switch Statement 1Write a switch statement that compares the
user's choice with the appropriate characters (make sure that both capital letters

Task #3 Switch Statement 1Write a switch statement that compares the user's choice with the appropriate characters (make sure that both capital letters and small letters willwork). Two ways to check for both capital and small letters: change input to all uppercase or add another case to the switch that handles the small letter. crusttype Anput.toUppercase 0) -charAt (0): (This converts character to uppercase) 2 Each case will assign the appropriate string indicating crust type to the crust variable. 3The default case will print a statement that the user input was not one of the choices, so a Hand-tossed crust will be made. switch (crust Type) switch (crustType) case H' : crust-"Hand-tossed": case T' : crust-"Thin-tossed" case "D : crust "Deep-dish: default : System.out.println (Incorrect Input: a Hand-tossed crust" will be prepared The above switch needs to be modified. Make the modifications to the switch statement and compile, debug, and run. You should now be able to get crust types other than Hand-tossed. Run your program multiple times to make sure all cases of the switch statement operate correctly Task #4 Using a Flag as a Condition Write an if statement that uses the flag as the condition. Remember that the flag is a Boolea

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!