Question: Part 2: Programming: (12 points Write a Java program called Assignment3.java. Your task is to implement a simple calculator. Your program will print a menu

Part 2: Programming: (12 points Write a Java program called Assignment3.java. Your task is to implement a simple calculator. Your program will print a menu using a switch statement and then ask user for two numbers and computes the result based on user option. Task: Prompt the user to enter two numbers as operands (type double), then print a menu to let user know what options are available (use ln and \t for formatting). Read the user's selection to determine which operation the user has chosen. Use a switch statement with user input as the switch expression. Your switch has to provide two cases for each operation: for example ADD" or +. For example, if the user enters ADD (in any combination of uppercase or lowercase letters) or a plus sign (+), your program will execute the addition and output the result. . Use only the Java statements that have been covered in class to date. DO NOT use any other statements (loop, array, etc.)or topic. If in doubt, ask your TA or instructor Example Execution: The following is an example input and output. The input is shown in red Example 1 Welcome to the calculator Enter the first operand: 23.4 Enter the second operand:3 Operations are: ADD or for addition SUBTRACT or- for subtraction MULTIPLY or * for multiplication DIVIDE or / for division Enter your selection: multiply The product is 70.2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
