/* University College London course in C++ 3C59 | all rights reserved 1999 | | Example: BankAccount in C++ | | BankAccount type as used in examples in the lectures | | This file shows you how to write the declaration of a | simple class including some methods | | It is incomplete so that the students can complete it | | Other methods are to be added, and withdrwal is to be | changed to return a bool | | Author: P.Clarke */ #ifndef _bankacc_inline_h #define _bankacc_inline_h 1 #include #include #include class BankAccount { private: std::string holderName ; float currentBalance ; float overdraftLimit ; bool jointAccount ; int yearsHeld ; public: //........................... // Returns the total funds available to be used float availableFunds( ) { return( currentBalance + overdraftLimit ) ; } // ****** students to modify to return a bool ****** //........................... // To make a withdrawl from the account if possible void withdrawl( float amount ) { // Check whether the withdrawl can be made if( amount > availableFunds( ) ) { // There are insufficient funds in the account return ; } else { // Its ok to make the withdrawl currentBalance -= amount ; return ; } } // **************Students to supply this method***************** //........................... // Initialise a new account void initialise( std::string name, float initial, float odlim ) { //........... add code here ........... } // **************Students to supply this method***************** //........................... // To make a deposit in the account void deposit( ??????????? ) { /// ...... put code in here ........ } // **************Students to supply this method***************** //........................... // To print out the account name and balance void printStatus( ) { // .... Put code in here ......... } } ; #endif