Introduction to C++
Jonah Warrenjonah AT parsons DOT edu
http://www.feedtank.com/2005/cpp
Homework 8
(Please email me if you have any questions.)- Review class code here.
- Read chapter 10 in C++ Primer Plus (if you didn't last time, which you probably didn't if you were working on your midterm).
- Define a class to represent a bank account.
- The class's variables should be private. They should include:
- Account owner's name.
- Account number.
- PIN number.
- Checking account balance.
- Savings account balance.
- Create a constuctor that allows you (the programmer) to set all of these variables.
- Create a bool function that checks to see if a given PIN number is correct.
- Create a void function that allows the user to make a deposit (to either checking or savings).
- Create a void function that allows the user to make a withdrawal (from either checking or savings).
- Create a void function that allows the user to transfer money from checking to savings.
- Create a void function that allows the user to transfer money from savings to checking.
- Now write a program that uses this object. You can set all the bank variables in your program.
It will probably look something like this:
BankAcct myAcct = BankAcct('Jonah Warren', 7845983443, 7593, 2341.34, 1265.03);
FINALLY, create an ATM program... kind of like a normal ATM experience, without the card swiping part. Allow them to make deposits, withdrawals and transfer money. The more realistic / features the better. (i.e. 'Do you want to complete another transaction?')