Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the Bank account assignment is confusing, I need any little tips that could make me understand this assignment. W Bank Accounts Assignment Purpose: The purpose

the Bank account assignment is confusing, I need any little tips that could make me understand this assignment.

image text in transcribedimage text in transcribed
W Bank Accounts Assignment Purpose: The purpose of this lab assignment is to demonstrate knowledge of creating and buildin- ob'ects of a class You are going to create a program that can deal with different types of bank accounts. The different classes will handle the different attributes and behaviors of their respective objectsBelow you will find the different classes, their attributes and behaivors. For this project you will be provided with 2 les: ATM.py and BankAccountFile.dat. ATM.py is the driving program for a completed project. This is what you will run to check that your work is done correctly once fully complete. This does not mean you have to wait till you have nished the project to test your methods however. You are encouraged to test what you write as you develop. The BankAccountFile.dat is a binary file that holds a list of Account objects. This le can be opened and read to help generate a list of accounts in the Bank class. This is also the le you will write too to save any changes you have made to the accounts in the Bank class. class Account(object): Attributes: - nextAccountNumber (static) a 5 digit integer value that represents the next account number to be used - default it to 12345 - accountNumber(private) 6 digit integer value that is obtained by the nextAccountNumber - name (private) Account holders first and last name passed by parameter a balance (private) - oating point number passed by parameter Methods - Constructor that accepts a name and balance by parameter, and initilzes the name and balance to the passed values. The accountNumber is initalized to the nextAccountNumber attribute and then nextAccountNumber is incremented by 1 a get methods for all private attributes deposit(self, amountm): void - increase the object balance by the passed amount a withdraw(self, amountm): boofean - decrease the objects balance by the passed amount if and only if the amount does not exceed the objects current balance. If the withdraw occured it should return True if it did not the method should return False - displayAccount(self):void should return a string to represent the account. The string should be formatted as you see it below 0 Name: Brandon Brzuszkiewicz Account Number: 1234567 Balance: $1532.23 class CheckingAccount(Account): Atri butes: interestRate (static) - oating point number initialized to 0.0125 minimumBalance (static) oating point number initialized to 500.00 Behaviors Constructor that accepts a name and balance by parameter and initializes an Account appropriatly An overwritten withdraw method that will perform a similar action to that of the Account class but will not let you withdraw below the minimumBalance. You must use the static variable minimumBalance for this action. This method should return True if a withdraw was made and false othenrvise. depositlnteresto - this should make a call to the deposit method to deposit the interest earned on the account. Interest earned is calculated by taking the balance multiplied by the interestRate and rounding the value to the nearest hundreth. (you must use the class attribute to perform the calculation) Overwrite displayAccount(self) should return a string to represent the account. The string should be formatted as you see it below a Name: Brandon Brzuszkiewicz Account Number: 1234567 Balance: $1532.23 Interest Rate 1.25% (use the static eld for value) class Bank(object): Attributes: accounts - list containning all the account objects of the program Behaviors: Constructor that does not require any parameters. It will initialize the accounts attributes through a call to the _generateAccounts function. The constructor should also set the nextAccountNumber eld in the Account class to the next available account number if there are accounts to be found in the data le. _generateAccounts(self) function that will open the BankAccountFiledat with read access to a binary file. It will load the file and populate the accounts attribute. Then close the file. If an error was to occure it would return an empty list for the accounts attribute writeToFile(self) open the BankAccountFiledat with write access to a binary le. It will dump the accounts list into the le and close the le addAccount(self, checking:bool) this will input for a name and balance. The create a checking account if the pass parameter is true with the name and balance, otherwise create an Account object witht the passed name and balance. It will then add the account to the accounts list ndAccount(self, number) _ nd and return an account object from the list with the passed account number. if no account if found it should return None removeAccountlself, number) This will nd and remove an account from the accounts list. If it can be found it should remove it and return True, otherwise it should return False displayAccounts(self): This should print all the accounts in the account list

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions