I need to check if name is same How can I check it?
I wrote function only How can I do add same name Ignore it??
this is same name don't ingore it.
How can I do Show up error??
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
struct b_customer {
string Bank_name;
string Last_Name;
string First_Name;
string Address;
string City;
string State;
double Deposit;
double Bonus;
double Total;
int Months;
};
void Add_Bank_customer (b_customer list [], int &size, int max, b_customer &Temp){
if (size < max)
{
cout << "\n\nPlease enter the data for Bank customer:\n";
cout << "Enter first name: ";
cin >> Temp.First_Name;
cout << "Enter last name: ";
cin >> Temp.Last_Name;
cout << "Enter Address: ";
cin.ignore();
getline(cin, Temp.Address);
cout << "Enter City: ";
cin >> Temp.City;
cout << "Enter State: ";
cin >> Temp.State;
cout << "Enter Deposit: ";
cin >> Temp.Deposit;
cout << "Enter Months: ";
cin >> Temp.Months;
Bouns(list[size]);
size++;
cout << "\n\n";
}
else
cout << "Array is full, can't add any more bank customers.\n\n";
}
|
Last edited on
1 2 3 4 5 6
|
if(Temp.Last_Name == Temp.Last_Name)
cout << "Error: the same last name" << endl;
else
{
...
}
|
1 2 3 4 5 6
|
if(Temp.Last_Name != Temp.Last_Name)
{
...
}
else
cout << "Error: the same last name" << endl;
|
Topic archived. No new replies allowed.