Program 1: Class & Objects
Write a class named as BankAccount. The class has following member
data and member functions.
Access Member Access Member Functions/ Methods
Modifier data/Attributes Modifier
Type Type
private char CusName[50] Public void setCusDetails()
{
This method will set the name
and ID of the customer. No cout in
this method.
}
float checkBalance()
{
// This method should return the
balance of the customer by taking
the input from the user.
}
char CusId[10] float depositMoney(float
amount)
{
// This method should allow user to
deposit money.
//no cout in this method
}
float accBalance float withdrawMoney(float
amount)
{
//write the method. This method
should allow user to withdraw
money
//no cout in this method
}
void showInfo()
{
// this method will print all
information (i.e. customer name, id,
deposit/withdraw/balance)
}
Create an object cusotmer1, customer 2 and access the above-mentioned
methods in the main(). Show the output on the console.
The main of the program is shown below:
int main()
BankAccount customer1,customer2;
[Link](); [Link]();
[Link](50000.00); [Link](20000.00);
[Link](); [Link]();
[Link](15000.00); [Link](5000.00);
[Link](); [Link]();