Provide the following instructions for writing an application that questions the user for two integers and then prompts the user to select one of the following options: 1 represents the addition of the two integers, 2 represents the subtraction of the second integer from the first, 3 represents the multiplication of the integers, and 4 represents the division of the first integer by the second. If the user selects an option other than 1 through 4 or if the user picks the divide option but inputs 0 for the second number, an error message will be displayed. Otherwise, the results of the arithmetic should be displayed. Fill in the blanks with your.java file. Include a flowchart and a sample output of your work. (Only switch statements should be used.)
Provide the following instructions for writing an application that questions the user for two integers and then prompts the user to select one of the following options: 1 represents the addition of the two integers, 2 represents the subtraction of the second integer from the first, 3 represents the multiplication of the integers, and 4 represents the division of the first integer by the second. If the user selects an option other than 1 through 4 or if the user picks the divide option but inputs 0 for the second number, an error message will be displayed. Otherwise, the results of the arithmetic should be displayed. Fill in the blanks with your.java file. Include a flowchart and a sample output of your work. (Only switch statements should be used.)
Step by step
Solved in 3 steps with 1 images