Hey
So, im working on my project and i got almost all of it except 2 parts
And im reading all the information by a text file
1)search the account number (which is in string) and print out the account details
2) add a new account to the collection of current account(i think in the array not in the text file), program should ask the user to input name and everything.
so here there 12 parts of this program and im stuck on last 2.
for part1 i have this code
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
|
else if(choice == 9)\\my part 9 begins
{
\\asking user for account number
cout << "Enter Account name or number : ";
getline(cin, ask, '\n');
\\scanning the array to find a match
for(int n=0; n<(z-1); n++)
{
\\transform converts user input to all lower case
transform( name[n].begin(), name[n].end(), name[n].begin(), lower_case );
\\checkin if the name entered by user is a match or no
\\name works!!
if (ask==name[n])
{
transform( ask.begin(), ask.end(), ask.begin(), lower_case);
cout << Account_number[n]
<< "\n" << name[n]
<< "\n" << balance[n]
<< "\n" << limit[n]<<endl;
}
cout<<ask<<endl;\\just to check
\\checking for account # now
if (ask == Account_number[n])
{
cout << Account_number[n]
<< "\n" << name[n]
<< "\n" << balance[n]
<< "\n" << limit[n]<<endl;
}
\\if user entered incorrect data then give error and back to menu
else
cout << "Incorrect name or account number"<<endl;
break;
}
}
|
So thats my part 1 code which in the program is part 9
so name search works but not the number please help
And for part 2 which is part 10 in my program
just need guidance how to add string to an array list(or basically just add an extra array)
and yes i know how to type in the basic asking user stuff and all
i just need a basic example how to add a new array
any help is much appreciated