Question: Use of if/else, possibly nested, to solve simple problems. Use of a switch statement to solve a multi-way decision. Write a program that asks the
Use of if/else, possibly nested, to solve simple problems. Use of a switch statement to solve a multi-way decision. Write a program that asks the user to enter 3 numbers, one at a time. Print the three numbers in sorted order. Examples (user input in blue): Enter number 1: 45 Enter number 2: 35 Enter number 3: 55 Sorted they are 35 45 55 Enter number 1: 55 Enter number 2: 45 Enter number 3: 35 Sorted they are 35 45 55 In the same program: Write code that will display the following menu: A. Aleppo Pepper B. Banana Pepper C. Cayenne Pepper D. Dragons Breath Enter a letter to choose a pepper: Use a switch statement to calculate the Scoville Units (measure of hotness): Aleppo = 30,000 Banana = 1,000 Cayenne = 40,000 Dragon's Breath = 2,480,000 Print the Scoville Units for the chosen pepper, example: That' s 1000 SU of heat! The program should handle both upper and lower case entries...that is 'A or 'a' should print the Scoville Units for the Aleppo. The program should print "That pepper not on the list" when the user enters anything besides A, B, C, D(or a, b, c, d)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
