0% found this document useful (0 votes)
19 views3 pages

CODEme 2

Uploaded by

shehzaibmirza428
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

CODEme 2

Uploaded by

shehzaibmirza428
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

[Year]

OOP LAB TASK

SHEHZAIB
S2024332016
CODE
#include <iostream>

using namespace std;


class bank{
public:
string despositerName;
int accountNumber;
float balanceAmount;
bank(string N = " Musa " , int ACC = 10 , float BA=100){
despositerName = N;
accountNumber = ACC;
balanceAmount = BA;
}
void deposit(float amount){
balanceAmount = balanceAmount + amount ;
cout<< " Amount Deposited = " << amount <<endl;
cout<< " New Balance = " << balanceAmount <<endl;
}
void withdraw(float amount){
if(amount > balanceAmount){
cout << " insufficient balance " << endl;
}
else{
balanceAmount = balanceAmount-amount;
cout<< " amount withdraw = " << amount <<endl;
cout<< " new balance = " << balanceAmount <<endl;
}

}
void display(){
cout << " Despositer Name = " << despositerName << endl;
cout << " Account Number = " << accountNumber << endl;
cout << " Balance Amount = " << balanceAmount << endl;

}
};
main() {
bank info;
info.display();
info.deposit(1000);

}
Output:

You might also like