Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python program Bank Account Need help! Assignment Overview This assignment focuses on the design, implementation and testing of a Python program which uses file processing
Python program "Bank Account"
Need help!
Assignment Overview This assignment focuses on the design, implementation and testing of a Python program which uses file processing and exception handling to solve the problem described below Assignment Specifications Consider a small bank which uses a text file to maintain information about its customers. Each customer record in that master file is stored on one line of the file and contains the following information Account number (6 characters) Account balance (10 characters) . Account holder (remaining characters on the line) There is exactly one space (blank) between the fields Account numbers range from 100000 to 999998 (inclusive). The account number 999999 is reserved as a sentinel to mark the end of the customer records (the last line of the file contains "999999") Account balances range from 0.00 to 9999999.99 (inclusive) Design, implement and test a Python program which allows the bank to interactively enter transactions and produces a new (updated) master file 1. The program will prompt the user to enter a file name prefix. That prefix will be used to generate the names of the two files by appending ".old.txt" and ".new.txt" to the prefix. For example, if the prefix is "customers", then the names will be "customers.old.txt" (the old master file) and "customers.new.txt" (the new master file) If the old master file cannot be opened for reading or the new master file cannot be opened for writing, the program will display an appropriate error message and not halt. 2. For each customer record in the old master file, the program will Display the customer information Prompt the user for any transactions related to that customer and process those transactions Write the customer record to the new master file (unless the account has been closed) . . The list of valid transactions is given below The format of the new master file will be the same as the format of the old master file: each customer record will contain the fields specified above, and the last line of the file will contain "999999" Assignment Overview This assignment focuses on the design, implementation and testing of a Python program which uses file processing and exception handling to solve the problem described below Assignment Specifications Consider a small bank which uses a text file to maintain information about its customers. Each customer record in that master file is stored on one line of the file and contains the following information Account number (6 characters) Account balance (10 characters) . Account holder (remaining characters on the line) There is exactly one space (blank) between the fields Account numbers range from 100000 to 999998 (inclusive). The account number 999999 is reserved as a sentinel to mark the end of the customer records (the last line of the file contains "999999") Account balances range from 0.00 to 9999999.99 (inclusive) Design, implement and test a Python program which allows the bank to interactively enter transactions and produces a new (updated) master file 1. The program will prompt the user to enter a file name prefix. That prefix will be used to generate the names of the two files by appending ".old.txt" and ".new.txt" to the prefix. For example, if the prefix is "customers", then the names will be "customers.old.txt" (the old master file) and "customers.new.txt" (the new master file) If the old master file cannot be opened for reading or the new master file cannot be opened for writing, the program will display an appropriate error message and not halt. 2. For each customer record in the old master file, the program will Display the customer information Prompt the user for any transactions related to that customer and process those transactions Write the customer record to the new master file (unless the account has been closed) . . The list of valid transactions is given below The format of the new master file will be the same as the format of the old master file: each customer record will contain the fields specified above, and the last line of the file will contain "999999Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started