[Lab Exercise] Classes and Objects
Problem Statement
Create a class named BankAccount with private attributes for the account holder's name, account number, and balance. Include member functions to deposit money, withdraw money, and display the current balance. Ensure that the balance cannot go below zero during a withdrawal.
Write a program to demonstrate the usage of the BankAccount class by creating instances, set Account Name, Account Number, and Balance. Performing deposit and two withdrawals, and displaying the account information.
Test Data
Input 1
Ramaguru
123456789
1000.0
500.0
200.0
1500.0
Output 1
Account Holder: Ramaguru
Account Number: 123456789
Current Balance: ₹1000
Deposited ₹500 into the account.
Withdrawn ₹200 from the account.
Insufficient balance or invalid withdrawal amount.
Account Holder: Ramaguru
Account Number: 123456789
Current Balance: ₹1300
Input 2
Ramaguru
123456789
1000.0
500.0
200.0
1200.0
Output 2
Account Holder: Ramaguru
Account Number: 123456789
Current Balance: ₹1000
Deposited ₹500 into the account.
Withdrawn ₹200 from the account.
Withdrawn ₹1200 from the account.
Account Holder: Ramaguru
Account Number: 123456789
Current Balance: ₹100
Comments
include<iostream>
using namespace std; cout<<"Hello World"<<endl; return 0; }