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 15:10
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Awide variety of “ apps “ are available to customize devices. which category of app does the word processing software fall into?
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
Select the correct answer. a company is currently focusing on creating specific management goals for itself. which level of maturity is the company demonstrating under the sse_ccm framework? a. performed informally b. planned and tracked c. quantitatively controlled d. well-defined e. continuously improving
Answers: 2
question
Computers and Technology, 23.06.2019 20:40
Instruction active describing list features which statements accurately describe the features of word that are used to create lists? check all that apply. the tab key can be used to create a sublist. the enter key can be used to add an item to a list. the numbering feature allows for the use of letters in a list. the numbering feature can change the numbers to bullets in a list. the multilevel list feature provides options for different levels in a list.
Answers: 2
You know the right answer?
Modify your program from week 5 so that the program utilizes object-oriented programming to create a...
Questions
question
Physics, 24.07.2019 21:00