//Part 2
switch(choice)
{
case 1:
cout<<"Enter a ten digit account number>"<<endl;
cin>>acno;
if(acno.length()!=10)
cout<<"Account number must be ten digits."<<endl;
if(linearSearch(acno,acNums,numAccs)>0)
cout<<acno<<" cannot be assigned to multiple customers."<<endl;
else
{
cout<<"Enter the first name>"<<endl;
cin>>fName;
cout<<"Enter the last name>"<<endl;
cin>>lName;
cout<<"Enter middle initial>"<<endl;
cin>>midInit;
cout<<"Enter initial deposit>"<<endl;
cin>>initBal;
}
if(initBal < 25.00)
cout<<"Insufficient funds to open account."<<endl;
else
openAccount(acno,fName,lName,midInit,initBal,acNums,fNames,lNames,
midInitials,balances,numAccs);
break;
//216
case 2:
cout<<"Enter a ten digit account number>"<<endl;
cin>>acno;
if(acno.length()!=10)
cout<<"Account number must be ten digits."<<endl;
else if(linearSearch(acno,acNums,numAccs)<0)
cout<<"Account number does not exist"<<endl;
else
closeAccount(acno,acNums,fNames,lNames,
midInitials,balances,numAccs);
break;
//228
case 3:
cout<<"Enter a ten digit account number>"<<endl;
cin>>acno;
if(acno.length()!=10)
cout<<"Account number must be ten digits."<<endl;
else if(linearSearch(acno,acNums,numAccs)<0)
cout<<"Account number does not exist"<<endl;
else
{
cout<<"Enter deposit amount>"<<endl;
cin>>amount;
}
if(amount<=0.00)
cout<<"Amount must be at least $0.01."<<endl;
else
deposit(acno,amount,acNums,balances,numAccs);
break;
//246
case 4:
cout<<"Enter a ten digit account number>"<<endl;
cin>>acno;
if(acno.length()!=10)
cout<<"Account number must be ten digits.";
else if(linearSearch(acno,acNums,numAccs)<0)
cout<<"Account number does not exist"<<endl;
else
{
cout<<"Enter withdrawal amount>"<<endl;
cin>>amount;
}
if(amount<=0.00)
cout<<"Amount must be at least $0.01."<<endl;
else
withdraw(acno, amount, acNums,balances,numAccs);
break;
//264
case 5:
cout<<"Enter a ten digit account number>"<<endl;
cin>>acno;
if(acno.length()!=10)
cout<<"Account number must be ten digits."<<endl;
else if(linearSearch(acno,acNums,numAccs)<0)
cout<<"Account number does not exist"<<endl;
else
inquiry(acno,acNums,fNames,lNames,midInitials,balances,numAccs);
break;
case 6:
customersList(acNums,fNames,lNames,balances,numAccs);
break;
case 0:
cout<<"Working!"<<endl;
break;
default:
cout<<"Enter a valid choice."<<endl;
exit(1);
break;
}
This is a class assignment meant to simulate a bank program. A ten digit account number must be enter, length verified, and then additional information entered and stored into parallel arrays. The program is to run until case 0 is chosen during which time outfiles are opened, updated, and closed.
If you need any clarification, I will try my best to answer.