subject

Modify your program from week 5 so that the program utilizes object-oriented programming to create an application which allows the user to create, delete or modify orders. Your program should do the following in order: 1. Define a class and class variables
2. Create a function to set the order amount
• Set order amount
3. Create a function to set order type
• Set order type
4. Create a function to set the order number
• Set order number
5. Create a function to get the order amount
• Return the order amount
6. Create a function to get the order type
• Return the order type
7. Create a function to get the order number
• Return the order number
8. Modify the function to display the order menu
Display a menu so that the user can select 1 of 6 options:
• Add Order
• Delete Order
• Edit Order
• Display Order
• Save Order
• Exit the Program
9. Create a new function to save the order items added to the list in a text file.
10. Repeatedly execute the menu selections unit the user enters 6 to exit the program.
Modify the code below
def Add_Transaction():
key = input("Enter new transaction: ")
transactions. append(key)
print("Added")
def Delete_Transaction():
key = input("Enter the Transaction key to delete: ")
transactions. remove(key)
print('Removed')
def Edit_Transaction():
key = input("Enter the transaction key to edit: ")
newkey = input("Enter new transaction key: ")
transactions[transactions. index(key)] = newkey
def printlist():
print("\n","*"*17,sep="")
print("** Transactions **")
count = 1
for key in transactions:
print(count,"."," ",key, sep="")
count += 1
print("*"*17)
transactions = []
choice = 0
while(choice != 5):
print(" Main Menu ")
print("1. Add Transaction")
print("2. Delete Transaction")
print("3. Edit Transaction")
print("4. Display Transactions")
print("5. Exit program")
choice = int(input("Selection> "))
if choice == 1:
Add_Transaction()
elif choice == 2:
Delete_Transaction()
elif choice == 3:
Edit_Transaction()
elif choice == 4:
printlist()
elif choice == 5:
print("Exit Program")

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:00
Which option should u select to ignore all tracked changes in a document
Answers: 1
question
Computers and Technology, 22.06.2019 13:00
Why the bear has a slunky tail determine the meaning of the word slunk in the story
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Which of the following would you find on a network
Answers: 3
question
Computers and Technology, 23.06.2019 08:00
The managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an .
Answers: 3
You know the right answer?
Modify your program from week 5 so that the program utilizes object-oriented programming to create a...
Questions
Questions on the website: 13722361