Opps2 PDF
Opps2 PDF
#include <iostream.h>
#include <string.h>
class BankAccount
private:
string depositorName;
long accountNumber;
char accountType;
double balance;
public:
depositorName = name;
accountNumber = accNumber;
accountType = type;
balance = initialBalance;
balance += amount;
{
if (amount <= balance)
balance -= amount;
cout << "Withdrawal of Rs. " << amount << " successful." << endl;
else
void display()
};
int main()
BankAccount accounts[5];
string name;
long accNumber;
char type;
double initialBalance;
cout << "Enter depositor name for account " << i+1 << ": ";
cout << "Enter account type (S for Savings, C for Current): ";
cout << "\nAccount Details for Customer " << i+1 << ":" << endl;
accounts[i].display();
accounts[i].deposit(depositAmount);
accounts[i].withdraw(withdrawAmount);
cout << "Updated Account Details for Customer " << i+1 << ":" << endl;
accounts[i].display();
return 0;
}
Output :-