Write a program for an coffee shop. The user will need to choose what type of roast and what type of flavor. You should have at least 3 choices, but you may use more. Use 2 switch statements. 1 for setting the roast and and 1 for setting the flavor and then let your user know what you made for them. Rather than having print statements within your switch statements, you'll want to set values to Strings. You declare and initialize a String variable the same way you do a primitive data type. String coffeeRoast = "dark"; or initialize to an empty String like this String coffeeRoast = ""; Depending on what the user enters, you can assign a value to a String and then use your String variables in your print statement in Java
Write a program for an coffee shop. The user will need to choose what type of roast and what type of flavor. You should have at least 3 choices, but you may use more. Use 2 switch statements. 1 for setting the roast and and 1 for setting the flavor and then let your user know what you made for them.
Rather than having print statements within your switch statements, you'll want to set values to Strings. You declare and initialize a String variable the same way you do a primitive data type. String coffeeRoast = "dark"; or initialize to an empty String like this String coffeeRoast = ""; Depending on what the user enters, you can assign a value to a String and then use your String variables in your print statement in Java
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images