Ashraful 22103225 (25) Project
Ashraful 22103225 (25) Project
Ashraful 22103225 (25) Project
Project-1
Prepared For
Jabunnesa Jahan Sara
Lecturer (IUBAT)
Prepared By
MD. Ashraful Haque
Section:F
ID: 22103225
Serial: 25
class Bank
{
protected:
float money,saving;
int year;
public:
Bank() {}
void displaymoney()
{
cout << endl;
cout << "\t\t\t\tMoney in bankA = " << current_amount << endl;
}
void displaysaving()
{
cout << endl;
cout << "\t\t\t\tSaving in bankA = " << saving << endl;
}
};
public:
void calculation(int y)
{
year = y;
saving = saving + (saving * ((interest / 100) * year));
}
void displaymoney()
{
cout << endl;
cout << "\t\t\t\tMoney in bankB = " << current_amount << endl;
}
void displaysaving()
{
cout << endl;
cout << "\t\t\t\tSaving in bankB = " << saving << endl;
}
};
int main()
{
Bank *ptr;
BankA o1;
BankB o2;
float current_amount;
float salary = 0;
bool trans = true;
int year;
float sav;
float saving = 0;
string Name;
salary += current_amount;
int choice;
do
{
cout << endl;
cout << "\t\t\t---------------YEARLY--------------"<< endl;
cout << "\t\t\t\tpress 1 to add yearly salary" << endl;
cout << "\t\t\t\tpress 2 to add saving" << endl;
cout << "\t\t\t\tpress 3 to show the saving amount in bank B" << endl;
cout << "\t\t\t\tPress 4 to transfer the amount to bank A"<< endl;
cout << "\t\t\t\tPress 5 to show the saving in bank A" << endl;
switch(choice)
{
case 1:
case 2:
case 3:
if (trans)
{
o2.setsaving(saving);
cout << endl;
cout << "\t\t\t\tEnter the year : ";
cin >> year;
o2.calculation(year);
ptr = &o2;
cout<<endl;
cout<<"\t\t\t\tClient Name : "<<Name<<endl;
ptr->displaysaving();
}
else
{
o2.setsaving(0);
o2.calculation(1);
ptr = &o2;
cout<<endl;
cout<<"\t\t\t\tClient Name : "<<Name<<endl;
ptr->displaysaving();
}
break;
case 4:
trans = false;
cout << endl;
cout<<endl;
cout<<"\t\t\t\tClient Name : "<<Name<<endl;
cout << "\t\t\t\tMoney transfer complete !! " << endl;
break;
case 5:
o1.setsaving(saving);
cout << endl;
cout << "\t\t\t\tEnter the year : ";
cin >> year;
o1.calculation(year);
ptr = &o1;
cout<<endl;
cout<<"\t\t\t\tClient Name : "<<Name<<endl;
ptr->displaysaving();
break;
case 6: break;
default:
cout << endl;
cout << "\t\t\t\tInvalid choice !!!! " << endl;
}
} while (choice != 7);
return 0;
}