Just so this does not seem too out of context and so I don't have to re-post ALL my code, here is my original question: Object is initializing to unwanted value
Question: How do I design the following code, within the for loop, so that it is a Transaction method, such as void Transaction::promptUser() and then asks the user whether they would like to perform a transaction on their checking or savings account? It will then ask what transaction they will want to do and it will affect the corresponding account.
int main () {
BankAccount checking(0.00);
BankAccount savings(0.00);
Transaction c(checking);
Transaction s(savings);
for(int i = 0; i < 10 ; i++) {
cout << "Make an option" << endl;
cout << "1. Checking " << endl;
cout << "2. Savings" << endl;
int choice;
cin >> choice;
if (choice == 1) {
c.prompt();
c.printReciept();
}
else {
s.prompt();
s.printReciept();
}
}
}