Need Help in this 2nd part of a function. If can please provide details, thanks.
ID: 3533568 • Letter: N
Question
Need Help in this 2nd part of a function. If can please provide details, thanks.Create a class called ATM. The objects of this class have one attribute: address (i.e. the location of the ATM). The ATM class has a static attribute which is the name of a data file that stores account information in a tabular CSV format. Each row of the table corresponds to single account, where the columns store the following in order - account holder name, account ID, PIN (4 digit numeric password) and total money in the account. The methods of the ATM class should be: the constructor which initializes the address, reads account information from the data file and creates an instance variable which is a list of BankAccount objects; a method called processTransactions. When processTransactions is called it should ask the user for account ID and PIN, then it should respond with either 1) wrong account information or 2) present a menu of choices - check account balance, withdraw, deposit or quit. The method should complete the task chosen and then return to presenting the menu and this should go on until the user chooses to quit. Need Help in this 2nd part of a function. If can please provide details, thanks.
Create a class called ATM. The objects of this class have one attribute: address (i.e. the location of the ATM). The ATM class has a static attribute which is the name of a data file that stores account information in a tabular CSV format. Each row of the table corresponds to single account, where the columns store the following in order - account holder name, account ID, PIN (4 digit numeric password) and total money in the account. The methods of the ATM class should be: the constructor which initializes the address, reads account information from the data file and creates an instance variable which is a list of BankAccount objects; a method called processTransactions. When processTransactions is called it should ask the user for account ID and PIN, then it should respond with either 1) wrong account information or 2) present a menu of choices - check account balance, withdraw, deposit or quit. The method should complete the task chosen and then return to presenting the menu and this should go on until the user chooses to quit.
Explanation / Answer
void checkBalance(total) { printf("Balance is %f",total); } void withdraw(int amt) { if(total>amt) { total=toal-amt; } else printf("Insufficent funds"); } void deposit(int amt) { total=total+amt; printf("Balance after deposit is %f",total); }
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.