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 12:50
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks.requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
Singing in the rain: this first part of the film shows the early history of motion picture. how accurate do you think the portrayal of the early motion picture industry is? why? is historical accuracy important in films and theater productions? explain.
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Pl i need the answer now ! which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
You know the right answer?
Modify your program from week 5 so that the program utilizes object-oriented programming to create a...
Questions
question
Mathematics, 09.03.2021 21:10
question
Mathematics, 09.03.2021 21:10
question
Mathematics, 09.03.2021 21:10
Questions on the website: 13722363