- 1
Create a structure to specify data of customers in a bank.The data to be stored is:Account no,Name,Balance in account.
1:Declare two variables above structure I.e customer detail in bank. 2:Write a function to input and display customer detail in a bank and call in main() 3:Display customer details whose balance is more than other customer.
2 Réponses
+ 2
struct customer {
int accNo;
string name;
double balance;
void print(){
cout......
}
void getInfo(){
cout...
cin...
}
};
bool operator > (const customer & c1, const customer & c2){
return c1.balance > c2.balance;
}
int main(){
customer cust1;
customer cust2;
cust1.getInfo();
cust2.getInfo();
cust1 > cust2? cust1.print():cust2.print();
return 0;
}
0
thanks Ms for helping !