SlideShare a Scribd company logo
1 of 14
Download to read offline
//Main File (usestudentacc.cpp)
#include
#include "studentacc.h"
using namespace std;
int m_menu();
int aid_menu();
int f_aid();
int getCharge(); //Different charges for student account
const int AID = 1, BALANCE = 2, QUIT = 3;
const int SCHOLARSHIPS = 1, WORK = 2;
int main()
{
Studentacc sa;
float cash, amount;
int choice, charge, aid;
cout << "Enter the amount availible for payment: $";
cin >> cash;
sa.setBalance(cash);
cout << fixed << showpoint << setprecision(2);
//School Fees
charge = getCharge();
sa.addCharge(charge);
amount = sa.getBalance();
sa.setBalance(amount);
if(amount<0)
{
cout << "You owe $" << (-1) * amount << "this semester" << endl;
}
else
{
cout << "Your balance is $" << amount << endl;
}
choice = m_menu();
while(choice !=QUIT)
{
if(choice == AID)
{
aid = f_aid();
sa.addCharge(amount);
}
choice = m_menu();
}
}
int m_menu()
{
int choice;
bool error = false;
cout << endl;
cout << "MAIN MENU" << endl;
cout << "1 Financial Aids" << endl;
cout << "2 Balance" << endl;
cout << "3 Quit" << endl;
do{
cout << "Enter option number: ";
cin >> choice;
if((choice > 3)||(choice < 1))
{
cout << "Invaid number. Choose 1 or 2, or 3. ";
error = true;
}
else
{
error = false;
}
}while(error == true);
return choice;
}//end intmenu
int getCharge()
{
int hours, tuition, dorm_plan, meal_plan, SA_fee, Technology_fee, total_fee;
char response;
bool error;
cout << "How many credits hours are you taking this semester? (max = 21) ";
cin >> hours;
do {
if((hours>21)||(hours<0))
{
cout << " That is an invalid credit hour(s). Enter a valid credit hour ";
error = true;
}
}while(error==true);
if(hours>17&&hours>12)
{
tuition = 9828; //Package deal
cout << " Your tuition is $9,828 ";
}
else if (hours>17)
{//increment by 615 every 1 credit after 17
tuition = (hours-17)*615+9828;
cout << " Your tuition is $";
}
else
{
tuition = hours * 819; //Part-time school
cout << " Your tuition is $" << tuition << endl;
}
do{
cout << " A fixed Student Association fee is collected from each" << endl;
cout << " enrolled student for the purpose of operating, maintaining," << endl;
cout << " improving and equipping the Student Association." << endl;
cout << "The Student Association fee is $" << SA_fee << endl;
SA_fee = 110;
} while(error == true);
do{
cout << " The technology fee is $" << Technology_fee << endl;
Technology_fee = 200;
} while(error == true);
do {
cout << " Are you staying in the dorm? (yes or no)  -->";
cout << " Enter y for yes or n for no.  ";
cin >> response;
if(response=='y')
{
cout << " Dorm plan is $1,850 ";
dorm_plan = 1850;
error = false;
}
else if(response=='n')
{
cout << " You don't have a dorm plan ";
dorm_plan = 0;
error = false;
}
else
{
cout << " Invalid character, please try again ";
error = true;
}
} while(error == true);
do {
cout << " Do you have a meal plan? (y or n) -->";
cout << " Enter y for yes or n for no.  ";
cin >> response;
if(response=='y')
{
cout << " Meal plan is $1,900 ";
meal_plan = 1900;
error = false;
}
else if(response=='n')
{
cout << " You don't have a meal plan ";
meal_plan = 0;
error = false;
}
else
{
cout << " Invalid character, please try again ";
error = true;
}
} while(error == true);
total_fee = tuition + SA_fee + Technology_fee + dorm_plan + meal_plan;
cout << " Your total charge is $" << total_fee << endl;
return total_fee;
}
int f_aid()
{
int choice, hours, n_scholarship;
bool error;
float rate, work_money, scholarship_money, total, scholarship;
choice = aid_menu();
while (choice != QUIT){
if(choice == WORK){
//Scholarships
do {
cout << " How many scholarships have you earned? (Min = 0, Max = 10) ";
cin >> n_scholarship;
if((n_scholarship<0)||(n_scholarship>10))
{
cout << " Invalid number, please try again ";
error = true;
}
else
{
for(int i=1; i<=n_scholarship; i++)
{
cout << " Enter amount for scholarship #" << i << " -->";
cin >> scholarship;
scholarship_money += scholarship;
}
cout << " You have added $" << scholarship_money << " to your account";
error = false;
}
} while(error==true);
}
else
{ //Work
do {
cout << " How many hours do you work? (Max = 25) ";
cin >> hours;
if((hours<0)||(hours>25))
{
cout << " The number of hours you enter is invalid, please try again ";
error = true;
}
else
{
do {
rate = 7.25;
work_money = hours * rate * 0.8 * 16;
cout << " You will make $" << work_money << " this semester ";
error = false;
} while(error==true);
error = false;
}
} while(error == true);
}
choice = aid_menu();
}
total = work_money + scholarship_money;
return total;
}
int f_menu()
{
int choice;
bool error = false;
cout << endl;
cout << "FINANCIAL AID MENU ";
cout << "1 Scholarships" << endl;
cout << "2 Work" << endl;
cout << "3 Main Menu" << endl;
do{
cout << "Enter a number between 1 and 3: ";
cin >> choice;
if((choice > 3)||(choice < 1))
{
cout << " Invalid number, try again ";
error = true;
}
else
{
error = false;
}
}while(error == true);
return choice;
return 0;
}
Solution
//Main File (usestudentacc.cpp)
#include
#include "studentacc.h"
using namespace std;
int m_menu();
int aid_menu();
int f_aid();
int getCharge(); //Different charges for student account
const int AID = 1, BALANCE = 2, QUIT = 3;
const int SCHOLARSHIPS = 1, WORK = 2;
int main()
{
Studentacc sa;
float cash, amount;
int choice, charge, aid;
cout << "Enter the amount availible for payment: $";
cin >> cash;
sa.setBalance(cash);
cout << fixed << showpoint << setprecision(2);
//School Fees
charge = getCharge();
sa.addCharge(charge);
amount = sa.getBalance();
sa.setBalance(amount);
if(amount<0)
{
cout << "You owe $" << (-1) * amount << "this semester" << endl;
}
else
{
cout << "Your balance is $" << amount << endl;
}
choice = m_menu();
while(choice !=QUIT)
{
if(choice == AID)
{
aid = f_aid();
sa.addCharge(amount);
}
choice = m_menu();
}
}
int m_menu()
{
int choice;
bool error = false;
cout << endl;
cout << "MAIN MENU" << endl;
cout << "1 Financial Aids" << endl;
cout << "2 Balance" << endl;
cout << "3 Quit" << endl;
do{
cout << "Enter option number: ";
cin >> choice;
if((choice > 3)||(choice < 1))
{
cout << "Invaid number. Choose 1 or 2, or 3. ";
error = true;
}
else
{
error = false;
}
}while(error == true);
return choice;
}//end intmenu
int getCharge()
{
int hours, tuition, dorm_plan, meal_plan, SA_fee, Technology_fee, total_fee;
char response;
bool error;
cout << "How many credits hours are you taking this semester? (max = 21) ";
cin >> hours;
do {
if((hours>21)||(hours<0))
{
cout << " That is an invalid credit hour(s). Enter a valid credit hour ";
error = true;
}
}while(error==true);
if(hours>17&&hours>12)
{
tuition = 9828; //Package deal
cout << " Your tuition is $9,828 ";
}
else if (hours>17)
{//increment by 615 every 1 credit after 17
tuition = (hours-17)*615+9828;
cout << " Your tuition is $";
}
else
{
tuition = hours * 819; //Part-time school
cout << " Your tuition is $" << tuition << endl;
}
do{
cout << " A fixed Student Association fee is collected from each" << endl;
cout << " enrolled student for the purpose of operating, maintaining," << endl;
cout << " improving and equipping the Student Association." << endl;
cout << "The Student Association fee is $" << SA_fee << endl;
SA_fee = 110;
} while(error == true);
do{
cout << " The technology fee is $" << Technology_fee << endl;
Technology_fee = 200;
} while(error == true);
do {
cout << " Are you staying in the dorm? (yes or no)  -->";
cout << " Enter y for yes or n for no.  ";
cin >> response;
if(response=='y')
{
cout << " Dorm plan is $1,850 ";
dorm_plan = 1850;
error = false;
}
else if(response=='n')
{
cout << " You don't have a dorm plan ";
dorm_plan = 0;
error = false;
}
else
{
cout << " Invalid character, please try again ";
error = true;
}
} while(error == true);
do {
cout << " Do you have a meal plan? (y or n) -->";
cout << " Enter y for yes or n for no.  ";
cin >> response;
if(response=='y')
{
cout << " Meal plan is $1,900 ";
meal_plan = 1900;
error = false;
}
else if(response=='n')
{
cout << " You don't have a meal plan ";
meal_plan = 0;
error = false;
}
else
{
cout << " Invalid character, please try again ";
error = true;
}
} while(error == true);
total_fee = tuition + SA_fee + Technology_fee + dorm_plan + meal_plan;
cout << " Your total charge is $" << total_fee << endl;
return total_fee;
}
int f_aid()
{
int choice, hours, n_scholarship;
bool error;
float rate, work_money, scholarship_money, total, scholarship;
choice = aid_menu();
while (choice != QUIT){
if(choice == WORK){
//Scholarships
do {
cout << " How many scholarships have you earned? (Min = 0, Max = 10) ";
cin >> n_scholarship;
if((n_scholarship<0)||(n_scholarship>10))
{
cout << " Invalid number, please try again ";
error = true;
}
else
{
for(int i=1; i<=n_scholarship; i++)
{
cout << " Enter amount for scholarship #" << i << " -->";
cin >> scholarship;
scholarship_money += scholarship;
}
cout << " You have added $" << scholarship_money << " to your account";
error = false;
}
} while(error==true);
}
else
{ //Work
do {
cout << " How many hours do you work? (Max = 25) ";
cin >> hours;
if((hours<0)||(hours>25))
{
cout << " The number of hours you enter is invalid, please try again ";
error = true;
}
else
{
do {
rate = 7.25;
work_money = hours * rate * 0.8 * 16;
cout << " You will make $" << work_money << " this semester ";
error = false;
} while(error==true);
error = false;
}
} while(error == true);
}
choice = aid_menu();
}
total = work_money + scholarship_money;
return total;
}
int f_menu()
{
int choice;
bool error = false;
cout << endl;
cout << "FINANCIAL AID MENU ";
cout << "1 Scholarships" << endl;
cout << "2 Work" << endl;
cout << "3 Main Menu" << endl;
do{
cout << "Enter a number between 1 and 3: ";
cin >> choice;
if((choice > 3)||(choice < 1))
{
cout << " Invalid number, try again ";
error = true;
}
else
{
error = false;
}
}while(error == true);
return choice;
return 0;
}

More Related Content

Similar to Main File (usestudentacc.cpp)#includeiostream #include .pdf

Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdfAccount.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdfanujmkt
 
I need help creating a basic and simple Java program. Here is the ex.pdf
I need help creating a basic and simple Java program. Here is the ex.pdfI need help creating a basic and simple Java program. Here is the ex.pdf
I need help creating a basic and simple Java program. Here is the ex.pdfrajeshjangid1865
 
Program.cs class Program { static void Main(string[] args).pdf
Program.cs class Program { static void Main(string[] args).pdfProgram.cs class Program { static void Main(string[] args).pdf
Program.cs class Program { static void Main(string[] args).pdfanandshingavi23
 
Classes(or Libraries)#include #include #include #include.docx
Classes(or Libraries)#include #include #include #include.docxClasses(or Libraries)#include #include #include #include.docx
Classes(or Libraries)#include #include #include #include.docxbrownliecarmella
 
main.cpp #include iostream #include iomanip #include fs.pdf
main.cpp #include iostream #include iomanip #include fs.pdfmain.cpp #include iostream #include iomanip #include fs.pdf
main.cpp #include iostream #include iomanip #include fs.pdfarwholesalelors
 
PHPUnit elevato alla Symfony2
PHPUnit elevato alla Symfony2PHPUnit elevato alla Symfony2
PHPUnit elevato alla Symfony2eugenio pombi
 
The Art of Transduction
The Art of TransductionThe Art of Transduction
The Art of TransductionDavid Stockton
 
c04.DS_Storec04comparison-operator.htmlBullseyec04com.docx
c04.DS_Storec04comparison-operator.htmlBullseyec04com.docxc04.DS_Storec04comparison-operator.htmlBullseyec04com.docx
c04.DS_Storec04comparison-operator.htmlBullseyec04com.docxclairbycraft
 
Hey, looking to do the following with this programFill in the multip.pdf
Hey, looking to do the following with this programFill in the multip.pdfHey, looking to do the following with this programFill in the multip.pdf
Hey, looking to do the following with this programFill in the multip.pdfrupeshmehta151
 
#include iostream #include cmath #include iomanipusing n.docx
#include iostream #include cmath #include iomanipusing n.docx#include iostream #include cmath #include iomanipusing n.docx
#include iostream #include cmath #include iomanipusing n.docxajoy21
 
Data::FormValidator Simplified
Data::FormValidator SimplifiedData::FormValidator Simplified
Data::FormValidator SimplifiedFred Moyer
 
C code This program will calculate the sum of 10 positive .docx
 C code This program will calculate the sum of 10 positive .docx C code This program will calculate the sum of 10 positive .docx
C code This program will calculate the sum of 10 positive .docxaryan532920
 
BUS 225 Air Transporstation SupEMPLOYEE IDDATE OF HIREDEPARTMENTPE
BUS 225 Air Transporstation SupEMPLOYEE IDDATE OF HIREDEPARTMENTPEBUS 225 Air Transporstation SupEMPLOYEE IDDATE OF HIREDEPARTMENTPE
BUS 225 Air Transporstation SupEMPLOYEE IDDATE OF HIREDEPARTMENTPEVannaSchrader3
 

Similar to Main File (usestudentacc.cpp)#includeiostream #include .pdf (15)

distill
distilldistill
distill
 
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdfAccount.h  Definition of Account class. #ifndef ACCOUNT_H #d.pdf
Account.h Definition of Account class. #ifndef ACCOUNT_H #d.pdf
 
I need help creating a basic and simple Java program. Here is the ex.pdf
I need help creating a basic and simple Java program. Here is the ex.pdfI need help creating a basic and simple Java program. Here is the ex.pdf
I need help creating a basic and simple Java program. Here is the ex.pdf
 
Program.cs class Program { static void Main(string[] args).pdf
Program.cs class Program { static void Main(string[] args).pdfProgram.cs class Program { static void Main(string[] args).pdf
Program.cs class Program { static void Main(string[] args).pdf
 
Classes(or Libraries)#include #include #include #include.docx
Classes(or Libraries)#include #include #include #include.docxClasses(or Libraries)#include #include #include #include.docx
Classes(or Libraries)#include #include #include #include.docx
 
main.cpp #include iostream #include iomanip #include fs.pdf
main.cpp #include iostream #include iomanip #include fs.pdfmain.cpp #include iostream #include iomanip #include fs.pdf
main.cpp #include iostream #include iomanip #include fs.pdf
 
PHPUnit elevato alla Symfony2
PHPUnit elevato alla Symfony2PHPUnit elevato alla Symfony2
PHPUnit elevato alla Symfony2
 
The Art of Transduction
The Art of TransductionThe Art of Transduction
The Art of Transduction
 
c04.DS_Storec04comparison-operator.htmlBullseyec04com.docx
c04.DS_Storec04comparison-operator.htmlBullseyec04com.docxc04.DS_Storec04comparison-operator.htmlBullseyec04com.docx
c04.DS_Storec04comparison-operator.htmlBullseyec04com.docx
 
Hey, looking to do the following with this programFill in the multip.pdf
Hey, looking to do the following with this programFill in the multip.pdfHey, looking to do the following with this programFill in the multip.pdf
Hey, looking to do the following with this programFill in the multip.pdf
 
#include iostream #include cmath #include iomanipusing n.docx
#include iostream #include cmath #include iomanipusing n.docx#include iostream #include cmath #include iomanipusing n.docx
#include iostream #include cmath #include iomanipusing n.docx
 
CakePHP workshop
CakePHP workshopCakePHP workshop
CakePHP workshop
 
Data::FormValidator Simplified
Data::FormValidator SimplifiedData::FormValidator Simplified
Data::FormValidator Simplified
 
C code This program will calculate the sum of 10 positive .docx
 C code This program will calculate the sum of 10 positive .docx C code This program will calculate the sum of 10 positive .docx
C code This program will calculate the sum of 10 positive .docx
 
BUS 225 Air Transporstation SupEMPLOYEE IDDATE OF HIREDEPARTMENTPE
BUS 225 Air Transporstation SupEMPLOYEE IDDATE OF HIREDEPARTMENTPEBUS 225 Air Transporstation SupEMPLOYEE IDDATE OF HIREDEPARTMENTPE
BUS 225 Air Transporstation SupEMPLOYEE IDDATE OF HIREDEPARTMENTPE
 

More from arasanmobiles

a) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdf
a) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdfa) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdf
a) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdfarasanmobiles
 
1. The evolution of transportation has generally led to changes in u.pdf
1. The evolution of transportation has generally led to changes in u.pdf1. The evolution of transportation has generally led to changes in u.pdf
1. The evolution of transportation has generally led to changes in u.pdfarasanmobiles
 
1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf
1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf
1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdfarasanmobiles
 
1) Name four properties of an OpenFileDialog that we often set prior.pdf
1) Name four properties of an OpenFileDialog that we often set prior.pdf1) Name four properties of an OpenFileDialog that we often set prior.pdf
1) Name four properties of an OpenFileDialog that we often set prior.pdfarasanmobiles
 
Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf
  Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf  Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf
Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdfarasanmobiles
 
DBA Company Income Statement For the period ended December 31,.pdf
    DBA Company   Income Statement   For the period ended December 31,.pdf    DBA Company   Income Statement   For the period ended December 31,.pdf
DBA Company Income Statement For the period ended December 31,.pdfarasanmobiles
 
Indicate whether the solute solid is generally so.pdf
                     Indicate whether the solute solid is generally so.pdf                     Indicate whether the solute solid is generally so.pdf
Indicate whether the solute solid is generally so.pdfarasanmobiles
 
in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf
                     in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf                     in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf
in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdfarasanmobiles
 
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdfPhenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdfarasanmobiles
 
B. When dissolved solute and undissolved solute e.pdf
                     B. When dissolved solute and undissolved solute e.pdf                     B. When dissolved solute and undissolved solute e.pdf
B. When dissolved solute and undissolved solute e.pdfarasanmobiles
 
Yes both men and women differ in their thinking, research has proved.pdf
Yes both men and women differ in their thinking, research has proved.pdfYes both men and women differ in their thinking, research has proved.pdf
Yes both men and women differ in their thinking, research has proved.pdfarasanmobiles
 
What is the probability that a five-card poker hand contains the a.pdf
What is the probability that a five-card poker hand contains the a.pdfWhat is the probability that a five-card poker hand contains the a.pdf
What is the probability that a five-card poker hand contains the a.pdfarasanmobiles
 
When using some Sounds and Audio Devices functions you see a message.pdf
When using some Sounds and Audio Devices functions you see a message.pdfWhen using some Sounds and Audio Devices functions you see a message.pdf
When using some Sounds and Audio Devices functions you see a message.pdfarasanmobiles
 
We can better understand it with the help of examples.Red flower -.pdf
We can better understand it with the help of examples.Red flower -.pdfWe can better understand it with the help of examples.Red flower -.pdf
We can better understand it with the help of examples.Red flower -.pdfarasanmobiles
 
The racial and ethnic makeup of the American people is in flux. New .pdf
The racial and ethnic makeup of the American people is in flux. New .pdfThe racial and ethnic makeup of the American people is in flux. New .pdf
The racial and ethnic makeup of the American people is in flux. New .pdfarasanmobiles
 
The ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdf
The ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdfThe ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdf
The ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdfarasanmobiles
 
The causal relationship in epidemiology is generally an observation .pdf
The causal relationship in epidemiology is generally an observation .pdfThe causal relationship in epidemiology is generally an observation .pdf
The causal relationship in epidemiology is generally an observation .pdfarasanmobiles
 
Since Lithium sulfate is an ionic compound and is soluble in water, .pdf
Since Lithium sulfate is an ionic compound and is soluble in water, .pdfSince Lithium sulfate is an ionic compound and is soluble in water, .pdf
Since Lithium sulfate is an ionic compound and is soluble in water, .pdfarasanmobiles
 
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfoperating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfarasanmobiles
 
Microbiology is the study of microscopic organisms such as virus, ba.pdf
Microbiology is the study of microscopic organisms such as virus, ba.pdfMicrobiology is the study of microscopic organisms such as virus, ba.pdf
Microbiology is the study of microscopic organisms such as virus, ba.pdfarasanmobiles
 

More from arasanmobiles (20)

a) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdf
a) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdfa) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdf
a) Here, H2PO4- Acts as acid and HPO42- as salt.In equation pKa of.pdf
 
1. The evolution of transportation has generally led to changes in u.pdf
1. The evolution of transportation has generally led to changes in u.pdf1. The evolution of transportation has generally led to changes in u.pdf
1. The evolution of transportation has generally led to changes in u.pdf
 
1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf
1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf
1) Transition state 2) Threshold energy 3) Catalysts or Intermed.pdf
 
1) Name four properties of an OpenFileDialog that we often set prior.pdf
1) Name four properties of an OpenFileDialog that we often set prior.pdf1) Name four properties of an OpenFileDialog that we often set prior.pdf
1) Name four properties of an OpenFileDialog that we often set prior.pdf
 
Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf
  Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf  Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf
Ecell = Eocell - (0.0592n)log (more dilute solnmore concd soln). .pdf
 
DBA Company Income Statement For the period ended December 31,.pdf
    DBA Company   Income Statement   For the period ended December 31,.pdf    DBA Company   Income Statement   For the period ended December 31,.pdf
DBA Company Income Statement For the period ended December 31,.pdf
 
Indicate whether the solute solid is generally so.pdf
                     Indicate whether the solute solid is generally so.pdf                     Indicate whether the solute solid is generally so.pdf
Indicate whether the solute solid is generally so.pdf
 
in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf
                     in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf                     in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf
in HCl [H+] concentration = 0.12M pH of HCl = -lo.pdf
 
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdfPhenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
Phenanthrene is a polycyclic aromatic hydrocarbon composed of three .pdf
 
B. When dissolved solute and undissolved solute e.pdf
                     B. When dissolved solute and undissolved solute e.pdf                     B. When dissolved solute and undissolved solute e.pdf
B. When dissolved solute and undissolved solute e.pdf
 
Yes both men and women differ in their thinking, research has proved.pdf
Yes both men and women differ in their thinking, research has proved.pdfYes both men and women differ in their thinking, research has proved.pdf
Yes both men and women differ in their thinking, research has proved.pdf
 
What is the probability that a five-card poker hand contains the a.pdf
What is the probability that a five-card poker hand contains the a.pdfWhat is the probability that a five-card poker hand contains the a.pdf
What is the probability that a five-card poker hand contains the a.pdf
 
When using some Sounds and Audio Devices functions you see a message.pdf
When using some Sounds and Audio Devices functions you see a message.pdfWhen using some Sounds and Audio Devices functions you see a message.pdf
When using some Sounds and Audio Devices functions you see a message.pdf
 
We can better understand it with the help of examples.Red flower -.pdf
We can better understand it with the help of examples.Red flower -.pdfWe can better understand it with the help of examples.Red flower -.pdf
We can better understand it with the help of examples.Red flower -.pdf
 
The racial and ethnic makeup of the American people is in flux. New .pdf
The racial and ethnic makeup of the American people is in flux. New .pdfThe racial and ethnic makeup of the American people is in flux. New .pdf
The racial and ethnic makeup of the American people is in flux. New .pdf
 
The ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdf
The ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdfThe ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdf
The ion responsible is HCO3-.HCO3- is the conjugate base of the we.pdf
 
The causal relationship in epidemiology is generally an observation .pdf
The causal relationship in epidemiology is generally an observation .pdfThe causal relationship in epidemiology is generally an observation .pdf
The causal relationship in epidemiology is generally an observation .pdf
 
Since Lithium sulfate is an ionic compound and is soluble in water, .pdf
Since Lithium sulfate is an ionic compound and is soluble in water, .pdfSince Lithium sulfate is an ionic compound and is soluble in water, .pdf
Since Lithium sulfate is an ionic compound and is soluble in water, .pdf
 
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfoperating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
 
Microbiology is the study of microscopic organisms such as virus, ba.pdf
Microbiology is the study of microscopic organisms such as virus, ba.pdfMicrobiology is the study of microscopic organisms such as virus, ba.pdf
Microbiology is the study of microscopic organisms such as virus, ba.pdf
 

Recently uploaded

DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17Celine George
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 

Recently uploaded (20)

DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 

Main File (usestudentacc.cpp)#includeiostream #include .pdf

  • 1. //Main File (usestudentacc.cpp) #include #include "studentacc.h" using namespace std; int m_menu(); int aid_menu(); int f_aid(); int getCharge(); //Different charges for student account const int AID = 1, BALANCE = 2, QUIT = 3; const int SCHOLARSHIPS = 1, WORK = 2; int main() { Studentacc sa; float cash, amount; int choice, charge, aid; cout << "Enter the amount availible for payment: $"; cin >> cash; sa.setBalance(cash); cout << fixed << showpoint << setprecision(2); //School Fees charge = getCharge(); sa.addCharge(charge); amount = sa.getBalance(); sa.setBalance(amount); if(amount<0) { cout << "You owe $" << (-1) * amount << "this semester" << endl; } else { cout << "Your balance is $" << amount << endl; } choice = m_menu();
  • 2. while(choice !=QUIT) { if(choice == AID) { aid = f_aid(); sa.addCharge(amount); } choice = m_menu(); } } int m_menu() { int choice; bool error = false; cout << endl; cout << "MAIN MENU" << endl; cout << "1 Financial Aids" << endl; cout << "2 Balance" << endl; cout << "3 Quit" << endl; do{ cout << "Enter option number: "; cin >> choice; if((choice > 3)||(choice < 1)) { cout << "Invaid number. Choose 1 or 2, or 3. "; error = true; } else { error = false; } }while(error == true); return choice; }//end intmenu int getCharge() {
  • 3. int hours, tuition, dorm_plan, meal_plan, SA_fee, Technology_fee, total_fee; char response; bool error; cout << "How many credits hours are you taking this semester? (max = 21) "; cin >> hours; do { if((hours>21)||(hours<0)) { cout << " That is an invalid credit hour(s). Enter a valid credit hour "; error = true; } }while(error==true); if(hours>17&&hours>12) { tuition = 9828; //Package deal cout << " Your tuition is $9,828 "; } else if (hours>17) {//increment by 615 every 1 credit after 17 tuition = (hours-17)*615+9828; cout << " Your tuition is $"; } else { tuition = hours * 819; //Part-time school cout << " Your tuition is $" << tuition << endl; } do{ cout << " A fixed Student Association fee is collected from each" << endl; cout << " enrolled student for the purpose of operating, maintaining," << endl; cout << " improving and equipping the Student Association." << endl; cout << "The Student Association fee is $" << SA_fee << endl; SA_fee = 110; } while(error == true); do{
  • 4. cout << " The technology fee is $" << Technology_fee << endl; Technology_fee = 200; } while(error == true); do { cout << " Are you staying in the dorm? (yes or no) -->"; cout << " Enter y for yes or n for no. "; cin >> response; if(response=='y') { cout << " Dorm plan is $1,850 "; dorm_plan = 1850; error = false; } else if(response=='n') { cout << " You don't have a dorm plan "; dorm_plan = 0; error = false; } else { cout << " Invalid character, please try again "; error = true; } } while(error == true); do { cout << " Do you have a meal plan? (y or n) -->"; cout << " Enter y for yes or n for no. "; cin >> response; if(response=='y') { cout << " Meal plan is $1,900 "; meal_plan = 1900; error = false; } else if(response=='n')
  • 5. { cout << " You don't have a meal plan "; meal_plan = 0; error = false; } else { cout << " Invalid character, please try again "; error = true; } } while(error == true); total_fee = tuition + SA_fee + Technology_fee + dorm_plan + meal_plan; cout << " Your total charge is $" << total_fee << endl; return total_fee; } int f_aid() { int choice, hours, n_scholarship; bool error; float rate, work_money, scholarship_money, total, scholarship; choice = aid_menu(); while (choice != QUIT){ if(choice == WORK){ //Scholarships do { cout << " How many scholarships have you earned? (Min = 0, Max = 10) "; cin >> n_scholarship; if((n_scholarship<0)||(n_scholarship>10)) { cout << " Invalid number, please try again "; error = true; } else { for(int i=1; i<=n_scholarship; i++) {
  • 6. cout << " Enter amount for scholarship #" << i << " -->"; cin >> scholarship; scholarship_money += scholarship; } cout << " You have added $" << scholarship_money << " to your account"; error = false; } } while(error==true); } else { //Work do { cout << " How many hours do you work? (Max = 25) "; cin >> hours; if((hours<0)||(hours>25)) { cout << " The number of hours you enter is invalid, please try again "; error = true; } else { do { rate = 7.25; work_money = hours * rate * 0.8 * 16; cout << " You will make $" << work_money << " this semester "; error = false; } while(error==true); error = false; } } while(error == true); } choice = aid_menu(); } total = work_money + scholarship_money; return total;
  • 7. } int f_menu() { int choice; bool error = false; cout << endl; cout << "FINANCIAL AID MENU "; cout << "1 Scholarships" << endl; cout << "2 Work" << endl; cout << "3 Main Menu" << endl; do{ cout << "Enter a number between 1 and 3: "; cin >> choice; if((choice > 3)||(choice < 1)) { cout << " Invalid number, try again "; error = true; } else { error = false; } }while(error == true); return choice; return 0; } Solution //Main File (usestudentacc.cpp) #include #include "studentacc.h" using namespace std; int m_menu();
  • 8. int aid_menu(); int f_aid(); int getCharge(); //Different charges for student account const int AID = 1, BALANCE = 2, QUIT = 3; const int SCHOLARSHIPS = 1, WORK = 2; int main() { Studentacc sa; float cash, amount; int choice, charge, aid; cout << "Enter the amount availible for payment: $"; cin >> cash; sa.setBalance(cash); cout << fixed << showpoint << setprecision(2); //School Fees charge = getCharge(); sa.addCharge(charge); amount = sa.getBalance(); sa.setBalance(amount); if(amount<0) { cout << "You owe $" << (-1) * amount << "this semester" << endl; } else { cout << "Your balance is $" << amount << endl; } choice = m_menu(); while(choice !=QUIT) { if(choice == AID) { aid = f_aid(); sa.addCharge(amount); }
  • 9. choice = m_menu(); } } int m_menu() { int choice; bool error = false; cout << endl; cout << "MAIN MENU" << endl; cout << "1 Financial Aids" << endl; cout << "2 Balance" << endl; cout << "3 Quit" << endl; do{ cout << "Enter option number: "; cin >> choice; if((choice > 3)||(choice < 1)) { cout << "Invaid number. Choose 1 or 2, or 3. "; error = true; } else { error = false; } }while(error == true); return choice; }//end intmenu int getCharge() { int hours, tuition, dorm_plan, meal_plan, SA_fee, Technology_fee, total_fee; char response; bool error; cout << "How many credits hours are you taking this semester? (max = 21) "; cin >> hours; do { if((hours>21)||(hours<0))
  • 10. { cout << " That is an invalid credit hour(s). Enter a valid credit hour "; error = true; } }while(error==true); if(hours>17&&hours>12) { tuition = 9828; //Package deal cout << " Your tuition is $9,828 "; } else if (hours>17) {//increment by 615 every 1 credit after 17 tuition = (hours-17)*615+9828; cout << " Your tuition is $"; } else { tuition = hours * 819; //Part-time school cout << " Your tuition is $" << tuition << endl; } do{ cout << " A fixed Student Association fee is collected from each" << endl; cout << " enrolled student for the purpose of operating, maintaining," << endl; cout << " improving and equipping the Student Association." << endl; cout << "The Student Association fee is $" << SA_fee << endl; SA_fee = 110; } while(error == true); do{ cout << " The technology fee is $" << Technology_fee << endl; Technology_fee = 200; } while(error == true); do { cout << " Are you staying in the dorm? (yes or no) -->"; cout << " Enter y for yes or n for no. "; cin >> response;
  • 11. if(response=='y') { cout << " Dorm plan is $1,850 "; dorm_plan = 1850; error = false; } else if(response=='n') { cout << " You don't have a dorm plan "; dorm_plan = 0; error = false; } else { cout << " Invalid character, please try again "; error = true; } } while(error == true); do { cout << " Do you have a meal plan? (y or n) -->"; cout << " Enter y for yes or n for no. "; cin >> response; if(response=='y') { cout << " Meal plan is $1,900 "; meal_plan = 1900; error = false; } else if(response=='n') { cout << " You don't have a meal plan "; meal_plan = 0; error = false; } else {
  • 12. cout << " Invalid character, please try again "; error = true; } } while(error == true); total_fee = tuition + SA_fee + Technology_fee + dorm_plan + meal_plan; cout << " Your total charge is $" << total_fee << endl; return total_fee; } int f_aid() { int choice, hours, n_scholarship; bool error; float rate, work_money, scholarship_money, total, scholarship; choice = aid_menu(); while (choice != QUIT){ if(choice == WORK){ //Scholarships do { cout << " How many scholarships have you earned? (Min = 0, Max = 10) "; cin >> n_scholarship; if((n_scholarship<0)||(n_scholarship>10)) { cout << " Invalid number, please try again "; error = true; } else { for(int i=1; i<=n_scholarship; i++) { cout << " Enter amount for scholarship #" << i << " -->"; cin >> scholarship; scholarship_money += scholarship; } cout << " You have added $" << scholarship_money << " to your account"; error = false; }
  • 13. } while(error==true); } else { //Work do { cout << " How many hours do you work? (Max = 25) "; cin >> hours; if((hours<0)||(hours>25)) { cout << " The number of hours you enter is invalid, please try again "; error = true; } else { do { rate = 7.25; work_money = hours * rate * 0.8 * 16; cout << " You will make $" << work_money << " this semester "; error = false; } while(error==true); error = false; } } while(error == true); } choice = aid_menu(); } total = work_money + scholarship_money; return total; } int f_menu() { int choice; bool error = false; cout << endl; cout << "FINANCIAL AID MENU ";
  • 14. cout << "1 Scholarships" << endl; cout << "2 Work" << endl; cout << "3 Main Menu" << endl; do{ cout << "Enter a number between 1 and 3: "; cin >> choice; if((choice > 3)||(choice < 1)) { cout << " Invalid number, try again "; error = true; } else { error = false; } }while(error == true); return choice; return 0; }