Pin-point something you are EXACTLY having problems with.
And for God's sake don't put line numbers before your code.
#include <iostream>
#include <fstream>
using namespace std;
enum AccountType
{unknown = -1, Checking, Savings, CreditCard, InstantAccess};
struct customerInfo
{
char firstName[20];
char lastName[20];
float amount;
AccountType type;
};
int main()
{
char choice;
bool terminate = false;
int i = 0;
const int SIZE = 100;
ifstream inFile;
ofstream outFile;
customerInfo myAccount[SIZE];
while ( !terminate )
{
cout << "WELCOME TO SO-AND-SO BANK!\n\n" << "Please enter an option, are you a:\n\n"
<< "A)Customer\n"
<< "B)Bank Employee\n"
<< "C)Bank Supervisor\n"
<< "D)Quit the application\n\n";
cin >> choice;
switch ( choice )
{
case 'a':
case 'A':
cout << "Welcome to So-and-So Bank Customer Services!\n" << "Please enter an option:\n\n";
cout << "A)Functions: Balance Inquiry\n"
<< "B)Deposit Funds\n"
<< "C)Withdraw funds\n"
<< "D)Transfer Funds to another account (like from Checking to Savings or to Credit Card)\n"
<< "E)Anything else that you want to add\n"
<< "F)Quit the application\n\n";
cin >> choice;
switch ( choice )
{
case 'a':
case 'A':
for ( i = 0; i < SIZE; i++ )
{
cout << "Enter your first name (20 characters or less):\n\n";
cin >> myAccount[i].firstName;
cout << "Enter your last name (20 characters or less):\n\n";
cin >> myAccount[i].lastName;
loop:
cout << "What type of account do you wish to view?\n\n"
<< " Checking\n" << " Savings\n" << " CreditCard\n"
<< " InstantAccess\n" << " Quit";
cin >> choice;
{
if ( choice == '1' )
{
myAccount[i].type = Checking;
}
if ( choice == '2' )
{
myAccount[i].type = Savings;
}
if ( choice == '3' )
{
myAccount[i].type = CreditCard;
}
if ( choice == '4' )
{
myAccount[i].type = InstantAccess;
}
if ( choice == '5' )
{
cout << "You have chosen to quit, we appreciate your business.";
terminate = true;
}
else
{
cout << "You've entered an invalid option, please try again";
goto loop;
}
}
cout << "Your account balance is: " << myAccount[i].amount;
};
break;
case 'b':
case 'B':
break;
case 'c':
case 'C':
break;
case 'd':
case 'D':
break;
case 'e':
case 'E':
break;
case 'f':
case 'F':
cout << "You have chosen to quit, we appreciate your business.";
terminate = true;
break;
default:
cout << "You have entered an invalid option, please try again.\n\n";
break;
}
break;
case 'b':
case 'B':
cout << "Welcome to So-and-So Bank Employee Services!\n" << "Please enter an option:\n\n";
cout << "A)Interface to ADD a new Customer to the Bank\n"
<< "B)Interface to DELETE a Customer from the Bank\n"
<< "C)Search for a Record based on a “Name of a Customer” (using simple Sequential Search)\n"
<< "D)Quit the application\n\n";
cin >> choice;
switch ( choice )
{
case 'a':
case 'A':
for ( i = 0; i < SIZE; i++ )
{
cout << "Enter your first name (20 characters or less):\n\n";
cin >> myAccount[i].firstName;
cout << "Enter your last name (20 characters or less):\n\n";
cin >> myAccount[i].lastName;
};
break;
case 'b':
case 'B':
break;
case 'c':
case 'C':
cout << "So-and-So Bank Customers:\n";
for ( i = 0; i < SIZE; i++ )
{
cout << i << ". " << myAccount[i].lastName << ", " << myAccount[i].firstName << "\n";
};
cout << "Select customer number:\n\n";
cin >> i;
break;
case 'd':
case 'D':
cout << "You have chosen to quit, we appreciate your business.";
terminate = true;
break;
default:
cout << "You have entered an invalid option, please try again.\n\n";
break;
}
break;
case 'c':
case 'C':
cout << "Welcome to So-and-So Bank Supervising Services!\n" << "Please enter an option:\n\n";
cout << "A)Ability to List Total Number of Customers in Bank\n"
<< "B)Ability to List Total Amount of Money in the Bank\n"
<< "C)Ability to List Total Deposits in a Day\n"
<< "D)Ability to List Total Withdrawals in a Day\n"
<< "E)Ability to see/query detailed LOG of all transactions\n"
<< "F)Quit the application\n\n";
cin >> choice;
switch ( choice )
{
case 'a':
case 'A':
break;
case 'b':
case 'B':
break;
case 'c':
case 'C':
break;
case 'd':
case 'D':
break;
case 'e':
case 'E':
break;
case 'f':
case 'F':
cout << "You have chosen to quit, we appreciate your business.";
terminate = true;
break;
default:
cout << "You have entered an invalid option, please try again.\n\n";
break;
}
break;
case 'd':
case 'D':
cout << "You have chosen to quit, we appreciate your business.";
terminate = true;
break;
default:
cout << "You have entered an invalid option, please try again.\n\n";
break;
}
}
return 0;
}