1. All the banks operating in India are controlled by RBI. RBI has set a well defined guideline (e.g. minimum interest rate, minimum balance allowed, maximum withdrawal limit etc) which all banks must follow. For example, suppose RBI has set minimum interest rate applicable to a saving bank account to be 4% annually; however, banks are free to use 4% interest rate or to set any rates above it.
Write a program to implement bank functionality in the above scenario. Note: Create few classes namely Customer, Account, RBI (Base Class) and few derived classes (SBI, ICICI, PNB etc). Assume and implement required member variables and functions in each class.
#include <iostream>
using namespace std;
// class BB hold the baisc guidelines for bank rules
class BB
{
public:
float minimumInterestRate = 4;
double mnimumBalanceAllowed = 500;
double maximumWithdrawl = 50000;
};
int main()
{
BB obj;
float rate;
double withdrawl;
double balance;
cout << "Enter interest rate \n";
cin >> rate;
if (obj.minimumInterestRate <= rate)
{
cout << "Eligible under BB rules\n";
}
else
{
cout << "Not elligible under BB rules\n";
}
cout << "Enter withdrawl \n";
cin >> withdrawl;
if (obj.maximumWithdrawl >= withdrawl)
{
cout << "Eligible under BB rules\n";
}
else
{
cout << "Not elligible under BB rules\n";
}
cout << "Enter minimum balance\n";
cin >> balance;
if (obj.mnimumBalanceAllowed <= balance)
{
cout << "Eligible under BB rules\n";
}
else
{
cout << "Not elligible under BB rules\n";
}
cin.get();
cin.get();
return 0;
}
Comments
Leave a comment