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 01:50
A.) generate scaffolding to create database for your application. develop all the entities identified in assignment #2. add any additional that may be identified later. b.) add data validation rules to the models that are appropriate for your application and data. c.) create links for each scaffold in the header section. part 2: application updates [30 points] a.) add two additional views to the "home" controller you created in assignment #1. b.) the two views should be named as “privacy" and "". c.) link the two newly created views in the footer section. hint: you would need to modify the “home" controller definition and create “privacy.html.erb" and “.html.erb" files in appropriate locations.
Answers: 3
question
Computers and Technology, 23.06.2019 02:00
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
question
Computers and Technology, 23.06.2019 04:20
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
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
question
Mathematics, 15.08.2020 20:01
Questions on the website: 13722361