Question
Assigment 1 program - Use this to enhance the calculator in the new question print(Start of Calculator Program) operator = input(Enter the desired operation (+,-*,/,**):)
Assigment 1 program - Use this to enhance the calculator in the new question
print("Start of Calculator Program")
operator = input("Enter the desired operation (+,-*,/,**):")
a = int(input("Enter the input number: ")) b = int(input("Enter the second input number: "))
if operator == '+': print(a,"+",b,"=", (a+b))
elif operator == '-': print(a,"-",b,"=", (a-b)) elif operator =='*': print(a,"*",b,"=", (a*b)) elif operator == '/': print (a,"/",b,"=", (a/b)) elif operator =='**': print(a,"**",b,"=", (a**b))
else: print("Error! Invalid Operator") print ("End of Calculator Program")
Allow multiple calculations to be entered during one program session, rather than just one Check that the entered operator is valid (validation). If not, print an appropriate error message and re-prompt the user for another operator Keep a running count of how many of each type of valid operations are entered during the session one for each of these:Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started