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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:00, lgary9462
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message “constructing”. write a main()function that instantiates one object of the testclass. save the file as testclass. cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array. c . run this program and observe the results.
Answers: 1
image
Computers and Technology, 23.06.2019 22:20, tagerryawilson6
If i uninstall nba 2k 19 from my ps4 will my career be gone forever?
Answers: 2
image
Computers and Technology, 24.06.2019 18:30, kristine2424
Is a type of bullying that takes place when a person intentionally posts negative information about another that is not true
Answers: 1
image
Computers and Technology, 25.06.2019 05:30, genyjoannerubiera
In 3-5 sentences describe how technology business professionals to be more efficient. include examples of hardware and software
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 in other subjects:

Konu
Mathematics, 09.07.2019 16:50