Question: D: R: E: Objective: Work with if-elif-else; Introduction to while loops; Use of simple functions; Introduction to menu driven programming. In this assignment you are

 D: R: E: Objective: Work with if-elif-else; Introduction to while loops;Use of simple functions; Introduction to menu driven programming. In this assignment

D: R: E: Objective: Work with if-elif-else; Introduction to while loops; Use of simple functions; Introduction to menu driven programming. In this assignment you are to make a rather simple basic calculator in which the user chooses an arithmetic operation, inputs two integers, and sees the result. All operations are with integers, so pay particular attention to what happens with division. The program should display a menu as follows: A: Addition S: Subtraction M: Multiplication Division Modulus To Exit Program It should ask the user to enter one of these choices and accept either lower or upper case for each. A if-elif-else statement must select the entry and call a method that will ask the user to input two integers, one at a time, perform the indicated operation, and print the result fully described as shown in a sample run below. NOTE: Each of these methods will be using a input function. If a character is entered that is not one of the above, the program should state such and continue by asking for another. The above process should be in a while loop that runs until an e or E is entered. Processing the character input must be done with a if-elif-else statement, with a call to the appropriate method in each if case A, S, M, D, and R. The case E should merely set the controlling boolean expression for the while statement to false, print the message that the program is terminating, and do nothing else, which has the effect of ending the program. Your program must have five methods, one each for A, S, M, D, and R. Give appropriate names to these. They don't have any parameter. They are doing the work of reading the numbers, giving the output, and returning nothing. These are called from within the if-elif- else in main. Your program should closely mimic the output shown below. Input from the use is underlined. Menu: Menu: S: M: D: R: Addition Subtraction Multiplication Division Modulus To Exit Program Addition Subtraction M: Multiplication Division R: Modulus E: To Exit Program Your choice: Enter first integer: 55 Enter second integer: 50 55 minus 50 is 5. Your choice! Enter first integer: 2300 Enter second integer: 131 2300 mod 131 = 73 Menu: Menu: A: Addition S: Subtraction M: Multiplication Division R: Modulus To Exit Program Addition S: Subtraction M: Multiplication D: Division Modulus To Exit Program Your choice: Enter first integer: 5D Enter second Integer: 55 50 minus 55 is -5. Your choice! a Enter first integer: 300 Enter second integer: 7 300 divided by 7 is 42. Menu: Menu: S: M: Addition Subtraction Multiplication Division Modulus To Exit Program R: E: A: Addition S: Subtraction M: Multiplication Division R: Modulus E: To Exit Program Your choice: D Enter first integer 5280 Enter second integer: 3 5280 divided by 3 is 1760. Your choice: 9 Ending program: Menu: A: S: M: D: R: E: Addition Subtraction Multiplication Division Modulus To Exit Program Your choice Enter first integer: 2300 Enter second Integer: 131 2300 times 131 is 301 300. (Sample Continued next column)

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!