Banking ATM Project C++ [on hold]
up vote
-3
down vote
favorite
Please help with the changing PIN number function.
"Account" is a structure type. The structure has first, last, balance, pin, and account number. I am not sure how to get a new pin and make sure it doesn't exist, and then add it to the array that is of type account.
This option should be executed by calling a function to be defined.
The function asks users for the account number, PIN number, and new PIN number.
It looks for the account in the array by calling another search function.
If the account exists and the PIN is correct, then the PIN number is updated in the array.
Otherwise (account inexistent or incorrect PIN),
an appropriate error message is displayed.
//prototype
void changePinNum(account, int&);
void changePinNum(account myBank, int& size){
// The function asks users for the account number, PIN number, and
//new PIN number. It looks for the account in the array by
//calling another search function.
cout << "Please enter your account number: " << endl;
int foundIndex= -1;
do{
cout << "Please enter your account number: " << endl;
cin >> myBank[size].accountNumber;
foundIndex = search(myBank, myBank[size].accountNumber, size);
}while(foundIndex != -1);
cout << "New PIN:" << endl;
cin >> myBank[size].pin;
}
// this is the search function in case you needed it
int search(int myArray,int searchAccount, int arraySize){
int index = -1; //where it's found at or -1 if account num isnt found
for(int i=0; i < arraySize; i++){
if(myArray[i] == searchAccount)
{
index = i;
}
}
return index;
}
c++
New contributor
csstd1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
put on hold as off-topic by Phrancis, vnp, 200_success, Sᴀᴍ Onᴇᴌᴀ, Ludisposed 2 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Phrancis, vnp, 200_success, Sᴀᴍ Onᴇᴌᴀ, Ludisposed
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-3
down vote
favorite
Please help with the changing PIN number function.
"Account" is a structure type. The structure has first, last, balance, pin, and account number. I am not sure how to get a new pin and make sure it doesn't exist, and then add it to the array that is of type account.
This option should be executed by calling a function to be defined.
The function asks users for the account number, PIN number, and new PIN number.
It looks for the account in the array by calling another search function.
If the account exists and the PIN is correct, then the PIN number is updated in the array.
Otherwise (account inexistent or incorrect PIN),
an appropriate error message is displayed.
//prototype
void changePinNum(account, int&);
void changePinNum(account myBank, int& size){
// The function asks users for the account number, PIN number, and
//new PIN number. It looks for the account in the array by
//calling another search function.
cout << "Please enter your account number: " << endl;
int foundIndex= -1;
do{
cout << "Please enter your account number: " << endl;
cin >> myBank[size].accountNumber;
foundIndex = search(myBank, myBank[size].accountNumber, size);
}while(foundIndex != -1);
cout << "New PIN:" << endl;
cin >> myBank[size].pin;
}
// this is the search function in case you needed it
int search(int myArray,int searchAccount, int arraySize){
int index = -1; //where it's found at or -1 if account num isnt found
for(int i=0; i < arraySize; i++){
if(myArray[i] == searchAccount)
{
index = i;
}
}
return index;
}
c++
New contributor
csstd1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
put on hold as off-topic by Phrancis, vnp, 200_success, Sᴀᴍ Onᴇᴌᴀ, Ludisposed 2 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Phrancis, vnp, 200_success, Sᴀᴍ Onᴇᴌᴀ, Ludisposed
If this question can be reworded to fit the rules in the help center, please edit the question.
2
Welcome to Code Review. Asking for advice on code yet to be written or implemented is off-topic for this site. See What topics can I ask about? for reference. Once you have written working code, you're welcome to ask a new question here and we can then help you improve it!
– Phrancis
2 hours ago
add a comment |
up vote
-3
down vote
favorite
up vote
-3
down vote
favorite
Please help with the changing PIN number function.
"Account" is a structure type. The structure has first, last, balance, pin, and account number. I am not sure how to get a new pin and make sure it doesn't exist, and then add it to the array that is of type account.
This option should be executed by calling a function to be defined.
The function asks users for the account number, PIN number, and new PIN number.
It looks for the account in the array by calling another search function.
If the account exists and the PIN is correct, then the PIN number is updated in the array.
Otherwise (account inexistent or incorrect PIN),
an appropriate error message is displayed.
//prototype
void changePinNum(account, int&);
void changePinNum(account myBank, int& size){
// The function asks users for the account number, PIN number, and
//new PIN number. It looks for the account in the array by
//calling another search function.
cout << "Please enter your account number: " << endl;
int foundIndex= -1;
do{
cout << "Please enter your account number: " << endl;
cin >> myBank[size].accountNumber;
foundIndex = search(myBank, myBank[size].accountNumber, size);
}while(foundIndex != -1);
cout << "New PIN:" << endl;
cin >> myBank[size].pin;
}
// this is the search function in case you needed it
int search(int myArray,int searchAccount, int arraySize){
int index = -1; //where it's found at or -1 if account num isnt found
for(int i=0; i < arraySize; i++){
if(myArray[i] == searchAccount)
{
index = i;
}
}
return index;
}
c++
New contributor
csstd1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Please help with the changing PIN number function.
"Account" is a structure type. The structure has first, last, balance, pin, and account number. I am not sure how to get a new pin and make sure it doesn't exist, and then add it to the array that is of type account.
This option should be executed by calling a function to be defined.
The function asks users for the account number, PIN number, and new PIN number.
It looks for the account in the array by calling another search function.
If the account exists and the PIN is correct, then the PIN number is updated in the array.
Otherwise (account inexistent or incorrect PIN),
an appropriate error message is displayed.
//prototype
void changePinNum(account, int&);
void changePinNum(account myBank, int& size){
// The function asks users for the account number, PIN number, and
//new PIN number. It looks for the account in the array by
//calling another search function.
cout << "Please enter your account number: " << endl;
int foundIndex= -1;
do{
cout << "Please enter your account number: " << endl;
cin >> myBank[size].accountNumber;
foundIndex = search(myBank, myBank[size].accountNumber, size);
}while(foundIndex != -1);
cout << "New PIN:" << endl;
cin >> myBank[size].pin;
}
// this is the search function in case you needed it
int search(int myArray,int searchAccount, int arraySize){
int index = -1; //where it's found at or -1 if account num isnt found
for(int i=0; i < arraySize; i++){
if(myArray[i] == searchAccount)
{
index = i;
}
}
return index;
}
c++
c++
New contributor
csstd1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
csstd1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
csstd1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 hours ago
csstd1
1
1
New contributor
csstd1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
csstd1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
csstd1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
put on hold as off-topic by Phrancis, vnp, 200_success, Sᴀᴍ Onᴇᴌᴀ, Ludisposed 2 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Phrancis, vnp, 200_success, Sᴀᴍ Onᴇᴌᴀ, Ludisposed
If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as off-topic by Phrancis, vnp, 200_success, Sᴀᴍ Onᴇᴌᴀ, Ludisposed 2 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Phrancis, vnp, 200_success, Sᴀᴍ Onᴇᴌᴀ, Ludisposed
If this question can be reworded to fit the rules in the help center, please edit the question.
2
Welcome to Code Review. Asking for advice on code yet to be written or implemented is off-topic for this site. See What topics can I ask about? for reference. Once you have written working code, you're welcome to ask a new question here and we can then help you improve it!
– Phrancis
2 hours ago
add a comment |
2
Welcome to Code Review. Asking for advice on code yet to be written or implemented is off-topic for this site. See What topics can I ask about? for reference. Once you have written working code, you're welcome to ask a new question here and we can then help you improve it!
– Phrancis
2 hours ago
2
2
Welcome to Code Review. Asking for advice on code yet to be written or implemented is off-topic for this site. See What topics can I ask about? for reference. Once you have written working code, you're welcome to ask a new question here and we can then help you improve it!
– Phrancis
2 hours ago
Welcome to Code Review. Asking for advice on code yet to be written or implemented is off-topic for this site. See What topics can I ask about? for reference. Once you have written working code, you're welcome to ask a new question here and we can then help you improve it!
– Phrancis
2 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
2
Welcome to Code Review. Asking for advice on code yet to be written or implemented is off-topic for this site. See What topics can I ask about? for reference. Once you have written working code, you're welcome to ask a new question here and we can then help you improve it!
– Phrancis
2 hours ago