Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how to write option 5,6,7 PYTHON instructions: 1 - ONLY USE THESE ( loops, if, files, dicts, functions, lists ) 2- if youre not gonna

how to write option 5,6,7 PYTHON
instructions:
1 - ONLY USE THESE ( loops, if, files, dicts, functions, lists )
2- if youre not gonna answer the question fully DONT ANSWER IT im sure chegg has better experts that could provide full , complete and correct answer
3- explain step by step for each line in the code
4- DONT IMPORT ANYTHING
image text in transcribed
image text in transcribed
image text in transcribed
Option 5: When the user select 5 , the system will ask for the account number. It ensures that the account in the system. Your choice:5 Enter account number888 There is no account with this number Please select one of the following: If it is in the system, it displays the following information about the account: Your choice: 5 Enter account number123 Name: Ahmed Rashed Status: Active Balance: 1608. Please select one of the following: Your choice:5 Enter account number456 Name: Noof Khaled Status: Closed Balance: . Please select one of the following: Option 6: When the user select 6, the system will ask for the account number. It ensures that the account in the system. Your choice: 6 Enter account number732 There is no account with this number Please select one of the following: If it is in the system, it displays the last five transaction related to that account. Enter account number 123 Name: Ahmed Rashed The last 5 transactions: d 500. w 780.8 w 100. d 250. w 100.8 Please select one of the following: Option 7: The system will display data of the top five accounts in terms of balance. If the number of accounts less than 5 , it displays all of them. Your choice:7 456 Noof Khaled . 123 Ahmed Rashed 1060.0 777 Ali Mahmodd 4560.8 Please select one of the following: Option 8: The system will save the data in the dictionary to the file "customers.txt" and terminate the main function. Banking Svstem Assume you are required to develop a banking system that tracks customers' records. You should be aware of the following features in banking systems: 1- When a new account is opened, its initial balance is zero. 2- The withdraw operation will decrease the balance. Only withdraw is accomplished if the balance is enough (the balance is equal or greater than the amount to be withdrawn). 3- The deposit operation will increase the balance. 4- Close an account means inactivate it, no deposit or withdraw operation can be done with closed accounts. 5- To close an account, its balance should be zero. The required system will keep track of the account's data and the transactions. 1- Account data: Every account has an account number, name, status, and balance. This data will be saved in a file called "customers.txt", where this data is separated by comma. To save space, the account status will be represented as one letter: ' a ' for active, and ' c ' for closed. 2- Transaction data : Transaction data (withdraw and deposit) will be save in a file called "transactions.txt". Every transaction is added to the file as a single line that contains: account number, transaction type ('d' for deposit, and ' w ' for withdraw), and the amount as follows: - To make your program more efficient and instead of accessing the files every time, you should upload the data at the beginning to a dictionary. Write a function to (or make it in the main) to read the data from file "customers.txt" and save it to a dictionary, where the key is the account number and the rest as value in a list as follows: \{123: ['Ahmed Rashed', 'a', '1000.0'], 456: ['Noof Khaled', 'c', '0.0'], 777: ['Ali Mahmood', 'a', '4500.0']\} Then all the operations in the system will be done on the data in the dictionary, like open account, close an account, ...etc. - Each function in the program will receive that dictionary to process the data. Only the transactions (withdraw, deposit) data that will be append to the file "transactions.txt". When user exists the system (option 8), your system should write the data of the dictionary to the file "customers.txt" in mode ' w ', so it is updated

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions

Question

socialist egalitarianism which resulted in wage levelling;

Answered: 1 week ago

Question

soyuznye (all-Union, controlling enterprises directly from Moscow);

Answered: 1 week ago