- Class: Account Private members:
int accNo
string accHolder
float balance
Static member:
int totalAccounts — tracks number of accounts created
- Constructors: Default Constructor
Parameterized Constructor to set values of accNo, accHolder, balance
Copy Constructor
-
Destructor: Should display: "Account {accNo} closed."
-
Member Functions: void deposit(float amt)
void withdraw(float amt)
void showDetails()
static void showTotalAccounts()
-
Friend Function: void showBalance(const Account &a) — should access private balance
-
Friend Class: A class LoanManager that can access private members of Account
Function: checkLoanEligibility(Account &a): Eligible if balance > ₹5000
- Inheritance: Class PremiumAccount inherits Account
Extra function: void premiumBenefits()
- Polymorphism: Use virtual function void welcomeMessage() in base class.
Override it in PremiumAccount
-
Use of this Pointer in setter methods.
-
Message Passing: Use functions to invoke behavior on objects like acc.deposit(1000);
-
Pass by Reference function to update multiple accounts at once.