Question: URGENT! Write a code in python that has functions for addition, subtraction, multiplication, division, reminder and exponential function. Users first inputs should be number, operator,

URGENT! Write a code in python that has functions for addition, subtraction, multiplication, division, reminder and exponential function. Users first inputs should be number, operator, number and then "=" or enter to get the result. After the result is calculated user should input operator, number then "=" or enter while treating the result as the first number. Program should be able to handle incorrect inputs (like other characters or symbols). If a user enters incorrect input, the program resumes from the last correct input. No exceptions should occur. Users should be able to use the M character to save the last input or result. Users can save as many numbers as they want. Users can list the saved numbers by using the P character. Users can retrieve and continue with any number they want from the list by using Rn where n is any number from the list larger than 0 (e.g. R1 will retrieve the first save element, R2 second, ) Entering invalid number should print: Result does not exist at location. List exists as long as the program runs. Everytime program is restarted the list is empty. Store list in memory. It should work like a calculator. Operator for addition is "+", for subtraction is "-", for multiplication is "*", for division is "/", for reminder is "%" and for exponential function is "^".

For example:

5

+

3

=

Output: 8

-

2

(enter)

Output: 6

Input: M

Input: /

Input: 3

=

Output: 2

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!