Source Code: Task 6
Source Code: Task 6
Write a structure to store the name, account number and balance of 50 customers and store
their information.
1 - Write a function to print the names of all the customers having balance less than $200.
2 - Write a function to add $100 in the balance of all the customers having more than $1000
in their balance and then print the incremented value of their balance.
Source code
#include<iostream>
#include<string>
using namespace std;
struct bank
{
public:
int acc;
string name;
float balance;
void Display()
{
cout << "Name::" << endl << name << endl;
cout << "Account Number::" << endl << acc << endl;
cout << "Balance::" << endl << balance << endl;
}
void add_balance()
{
if (balance > 1000)
{
balance = balance + 100;
Display();
}
}
};
int main()
{
bank person[50];
for (int i = 0; i < 50; i++)
{
cout << "Enter Name: :\n";
cin.ignore();
getline(cin, person[i].name);
system("pause");
return 0;
}