This programming project will be a simple, working program, using Python language, which utilizes a good design process and includes:
-
Sequential, selection, and repetitive programming statements as well as,
-
At least one function call.
Pls design (based on the pseudo code in Project 1), create, debug and execute the program.
Pls use the Pseudo code below
Show Menu : ask to Enter choice
Enter num1
?if not a number
Ask to Re-enter until a number
?Enter num2
?if not inte
Ask to Re-enter until a number
?Compute the operation
Display Result
?If choice was not "Quit"
Start again from beginning
choice = 0
num1Check = "No"
num2Check = "No"
while choice != "6":
print ("Menu :")
print ("1. Addition")
print ("2. Subtraction")
print ("3. Multiplication")
print ("4. Division")
print ("5. Display both numbers.")
print ("6. Exit")
choice=input("Enter your choice : ")
if choice !="6":
num1 = input("Enter first number : ");
while num1Check!="Ok":
if (num1.isnumeric()):
num1Check="Ok"
num1=float(num1)
else:
num1 = input("ERROR !!! Enter a number : ");
num2 = input("Enter second number : ");
while num2Check != "Ok":
if (num2.isnumeric()):
num2Check = "Ok"
num2=float(num2)
else:
num2 = input("ERROR !!! Enter a number : ");
if choice == "1":
answer = num1+num2
print ("sum of two numbers is : ")
print (answer)
elif choice == "2":
answer = num1 - num2
print ("sum of two numbers is : ")
print (answer)
elif choice == "3":
answer = num1 * num2
print ("sum of two numbers is : ")
print (answer)
elif choice == "4":
answer = num1 / num2
print ("sum of two numbers is : ")
print (answer)
elif choice == "5":
print ("First number is ")
print (num1)
print ("Second number is "+num2)
print (num2)
elif choice == "6":
print ("Good Bye !")
The docmentation within the program should include:
Name - L Gates
Course - CMST 290
Program Name
Due Date - May 4, 2014
Programming Language Used -
List any requirements/steps to run the program:
< >
The program must be submitted as an executable file.
as Python(.py) file.