hey guys heres a pop machine program ive been working on and i juss cant seem to understand why im gettin errors especially some of the semi colon errors any help would be much appreciated ty in advance

//File: Assignment 3
//Programmer: Ravi Mandair CPSC 1103 S. 10
//Purpose: To simulate a pop machine
#include<iostream>
#include<string>
#include<cstdlib>
#include<fstream>
#include<cstring>
usingnamespace std;
char choices(); // purchaser choices
char inventory(); // user selection
char settings_menu(); // maintenance choice
bool check_availability (char, int, int, int, int); //item availability
bool price_match (double, double); //actual money entered/price
bool verify_password (char [8]); // checks correct pass
double change_calculator (double, double); //difference b/w tendered & price
double get_price (double, int&, int&, int&, int&, int&); // enter money and calc total value
string greeter (); // greets user
void apologizer (); // apology if item is out of stock
void changer (double, double, int&, int&, int&, int&, int&); //calcs change if it is more than purchase price
void error_money (); // if less money than purchase price gives error msg
void exiter (string); // thank you msg
void inventory_balance (); // opens inventory log/initalizes
void iventory_update (char, int&, int&, int&, int&);
void new_inventory_balance();
void new_till_balance();
void order_out();
void password_changer();
void prices();
void price_changer();
void price_display (char, double&, double, double, double, double);
void reciept (char);
void till_balance();
void viewer();
// Variable Declarations
char password[8];
double price_bar;
double price_choc;
double price_juice;
double price_soda;
int nickel_till;
int dime_till;
int quarter_till;
int loonie_till;
int toonie_till;
int bar;
int chocolate;
int juice;
int soda;
ifstream fin, inventory_in, price_in, pin;
ofstream fout, inventory_out, price_out, pout;
int main()
{
//variable declaration
bool availability;
bool check_price;
bool check_password;
char selection;
char purchase_selection;
char setting;
double price;
double money_recieved;
double change;
string name;
till_balance();
inventory balance ();
prices();
name = greeter ();
do
{
selection = choices ();
switch (selection)
{
case 'P':
case'p':
if ((nickel_till >=5) && (dime_till >=5) && (quarter_till >=5) && (loonie_till >=5) && (toonie_till >=5))
{
purchase_selection = inventory ();
if (purchase_selection == 'X' || purchase_selection == 'x')
break;
else
availability = check_availability (purchase_selection, bar, chocolate, juice, soda);
if (availability)
{
price_display (purchase_selection, price, price_bar, price_choc, price_juice, price_soda);
money recieved = get_price (price, nickel_till, dime_till, quarter_till, loonie_till, toonie_till);
check_price = price_match (price, money_recieved);
if (check_price)
{
reciept (purchase_selection);
inventory_update (purchase_selection, bar, chocolate, juice, soda);
}
else
{
change = change_calculator (money_recieved, price);
if (change > 0)
{
changer (money_recieved, change, nickel_till, dime_till, quarter_till, loonie_till, toonie_till);
inventory_update (purchase_selection, bar, chocolate, juice, soda);
}
else
error_money ();
}
}
else
apologizer ();
}
else
order_out();
break;
case 'U':
case 'u':
cout<<"Please enter 7 character password: "<<endl;
cin>>password;
check_password = verify_password (password);
if (check_password)
{
setting = settings_menu();
switch (setting)
{
case 'V':
case 'v':
viewer();
break;
case 'T':
case 't':
new_till_balance();
break;
case 'I':
case 'i':
new_inventory_balance();
break;
case 'P':
case 'p':
price_changer();
break;
case 'C':
case 'c':
password_changer();
break;
default:
cout<<"\nSettings Saved\n";
}
}
else
cout<<"\nNo entry\n";
break;
case 'X':
case 'x':
exiter(name);
break;
default:
cout<<endl
<<"Try again!"<<endl;
}
}while (selection != 'X' && selection != 'x');
cout<<"Written by Ravi Mandair CPSC 1103 S.10"<<endl;
return 0;
}
char inventory ()
{
char menu;
cout<<endl
<<"Please enter a choice"<<endl;
<<"G Granola Bar"<<endl;
<<"H Hot chocolate"<<endl;
<<"J juice"<<endl;
<<"S Soda"<<endl;
<<"X Exit"<<endl;
cin>>menu;
return menu;
}
bool check_availability (char_item, int item_1, int item_2, int item_3, int item_4)
{
bool_checker;
if ((item == 'G') || (item == 'g') && (item_1 > 0)
checker = true;
if ((item == 'G') || (item == 'g') && (item_1 == 0)
checker = false;
if ((item == 'H') || (item == 'h') && (item_2 > 0)
checker = true;
if ((item == 'H') || (item == 'h') && (item_2 == 0)
checker = false;
if ((item == 'J') || (item == 'j') && (item_3 > 0)
checker = true;
if ((item == 'J') || (item == 'j') && (item_3 == 0)
checker = false;
if ((item == 'S') || (item == 's') && (item_4 > 0)
checker = true;
if ((item == 'S') || (item == 's') && (item_4 == 0)
checker = false;
return checker;
}
void price_display (char inventory_slected, double& price, double price_1, double price_2, double price_3, double_price_4)
{
if ((inventory_selected == 'G') || (inventory_selected == 'g'))
{
cout<<"The price is $ "<<price_1<<endl;
price = price_1;
}
if ((inventory_selected == 'H') || (inventory_selected == 'h'))
{
cout<<"The price is $ "<<price_2<<endl;
price = price_2;
}
if ((inventory_selected == 'J') || (inventory_selected == 'j'))
{
cout<<"The price is $ "<<price_3<<endl;
price = price_3;
}
if ((inventory_selected == 'S') || (inventory_selected == 's'))
{
cout<<"The price is $ "<<price_4<<endl;
price = price_4;
}
return;
}
double get_price (double price_item, int& till_n, int& till_d, int& till_q, int& till_l, int& till_t)
{
int nickel;
int dime;
int quarter;
int loonie;
int toonie;
double tendered_monies;
cout<<"\nPlease enter $"<<price_item<<" in N D Q L T: ";
cin>>nickel>>dime>>quarter>>loonie>>toonie;
tendered_monies = ((00.5*nickel) + (.10*dime) + (0.25*quarter) + (1.00*loonie) + (2.00*toonie));
if (tendered_monies >= price_item)
{
till_n = nickel + till_n;
till_d = dime + till_d;
till_q = quarter + till_q;
till_l = loonie + till_l
till_t = toonie + till_t;
}
fout.open ("E:\\Ravi\\prev_balance.txt");
if (fout.fail ()()
{
cout<<"ERROR: cant open prev_balance.txt"<<endl;
return EXIT_FAILURE;
}
fout<<till_n<<endl<<till_d<<endl<<till_q<<endl<<till_l<<endl<<till_t<<endl;
fout.close();
return tendered_monies;
}
bool price_match (double price_of_item, double money_from_user)
{
bool price_checker;
if (price_of_item == money_from_user)
price_checker = true;
else
price_checker = false;
return price_checker;
}
void error_money ()
{
cout<<"\nSorry not enough. Collect change from dispenser"<<endl;
return;
}
double change_calculator (double tendered, double price_item)
{
double change;
if(tendered > price_item)
{
change = tendered - price_item;
cout<<"\nYour change $"<<change<<" is being processed.\n";
}
else 
return -1;
return change;
}
void changer (double tender, double_change, int& nickel_t, int& dime_t, int& quarter_t, int& loonie_t, int& toonie_t)
{
int toonie_number, loonie_number, quarter_number, dime_number, nickel_number;
toonie number = 0;
loonie_number = 0;
quarter_number = 0;
dime_number = 0;
nickel_number = 0;
while ((change >= 2.00) && (toonie_t > toonie_number))
{
change = change - 2.00;
toonie_number++;
to0nie_t--;
}
while ((change >= 1.00) && (loonie_t > loonie_number))
{
change = change - 1.00;
loonie_number++;
loonie_t--;
}
while ((change >= 0.25) && (quarter > quarter_number))
{
change = change - 0.25;
quarter_number++;
quarter_t--;
}
while ((change >= 0.10) && (dime_t > dime_number))
{
change = change - 0.10;
dime_number++;
dime_t--;
}
while ((change >= 0.05) && (nickel_t > nickel_number))
{
change = change - 0.05;
nickel_number++;
nickel_t--;
}
cout<<"\nCollect your change T L Q D N:\n"
<<toonie_number<<" "<<loonie_number<<" "<<quarter_number<<" "<<dime_number<<" "<<nickel_number<<endl;
fout.open ("E:\\Ravi\\prev.balance.txt"<<endl;
exit(1);
}
fout<<nickel_t<<endl<<dime_t<<quarter_t<<endl<<loonie_t<<endl<<toonie_t<<endl;
fout.close();
return;
}
void reciept (char selection)
{
if ((selection == 'G') || (selection == 'g'))
cout<<"\nCollect Granola bar from dispenser\n";
if ((selection == 'H') || (selection == 'h'))
cout<<"\nCollect Hot Chocolate from dispenser\n";
if ((selection == 'J') || (selection == 'j'))
cout<<"\nCollect juice from dispenser\n";
if ((selection == 'S') || (selection == 's'))
cout<<"\nCollect Soda from dispenser\n";
return;
}
void inventory_update (char selection_inventory, int& item_1, int& item_2, int& item_3, int& item_4)
{
if (( selection_inventory == 'G' || (selection_inventory == 'g'))
item_1--;
if (( selection_inventory == 'H' || (selection_inventory == 'h'))
item_2--;
if (( selection_inventory == 'J' || (selection_inventory == 'j'))
item_3--;
if (( selection_inventory == 'S' || (selection_inventory == 's'))
item_4--;
 
inventory_out.open ("E:\\Ravi\\inventory.txt");
if (inventory_out.fail ())
{
cout<<"ERROR cant open inventory.txt."<<endl;
exit (1);
}
inventory_out<<item_1<<endl<<item_2<<endl<<item_3<<endl<<item_4<<endl;
inventory_out.close();
reutrn;
}
void apologizer ()
{
cout<<"\nSorry Out of Stock.\n";
return;
}
void exiter (string user)
{
cout<<endl
<<"Thank you for using the Pop Machine,\n"
<<"have a nice day, "<<user<<"."<<endl;
return;
}
char choices ()
{
char select;
cout<<endl
<<"Select an option:\n"
<<"P Purchase\n"
<<"U Update till/inventory\n"
<<"X Exit\n"
cin>>select;
return select;
}
void order_out()
{
cout<<"\n Out of Order\n";
return ;
}
string greeter ()
{
string namer;
cout<<"Welcome to the Pop Machine\n"
<<"Enter your name:\n";
cin>>namer;
return namer;
}
void till_balance()
{
fin.open ("E:\\Ravi\\prev_balance.txt");
if (fin.fail())
{
cout<<"ERROR cant open prev_balance.txt."<<endl;
exit (1);
}
fin>>nickel_till>>dime_till>>quarter_till>>loonie_till>>toonie_till;
fin.close();
return;
}
void inventory_balance ()
{
inventory_in.open ("E:\\Ravi\\inventory.txt");
if (inventory_in.fail) ())
{
cout<<"ERROR cant open inventory.txt."<<endl;
exit (1);
}
inventory_in>>bar>>chocolate>>juice>>soda;
inventory_in.close();
return;
}
void prices()
{
price_in.open ("E:\\Ravi\\price_in.txt");
if (price_in.fail) ())
{
cout<<"ERROR cant open price_in.txt."<<endl;
exit (1);
}
price_in>>price_bar>>price_choc>>price_juice>>price_soda;
price_in.close();
return ;
}
bool verify_password (char entered_password[8])
{
bool verify;
car set_password[8];
pin.open ("E:\\Ravi\\password.txt");
if (pin.fail) ())
{
cout<<"ERROR cant open password.txt."<<endl;
exit (1);
}
pin>>set_password;
pin.close();
if(strcmp(set_password, entered_password))
verify = false;
else
verify = true;
return verify;
}
void viewer()
{
till_balance();
inventory_balance ();
prices();
cout<<"\nThe number of coins in till are N D Q L T:\n"
<<nickel_till<<" "<<dime_till<<" "<<quarter_till<<" "<<loonie_till<<" "<<toonie_till;
cout<<"\nNumber of granola bars, hot chocolate, juices and sodas are :\n"
<<bar<<" "<<chocolate<<" "<<juices<<" "<<soda<<" accordingly.\n";
cout<<"\nThe prices are:\n"
<<"granola bar $"<<price_bar<<endl
<<"hot_chocolate $"<<price_choc<<endl
<<"juice $"<<price_juice<<endl
<<"soda $<<price_soda<<endl;
return;
}
void new_till_balance()
{
cout<<"\nPlease enter the number of N D Q L T:\n";
cin>>nickel_till>>dime_till>>quarter_till>>loonie_till>>toonie_till;
fout.open ("E:\\Ravi||prev_balance.txt");
if (fout.fail ())
{
cout<<"Error cant open prev_balance.txt."<<endl;
exit(1);
}
fout<<nickel_till<<endl<<dime_till<<endl<<quarter_till<<endl<<loonie_till<<endl<<toonie_till;
fout.close();
return;
}
void new_inventory_balance()
{
cout<<"\nEnter number of granola bars , hot chocolate, juices and sodas:\n";
cin>>bar>>chocolate>>juice>>soda;
inventory_out.open ("E:\\Ravi\\inventory.txt");
if (inventory_out.fail ())
{
cout<<"ERROR cant open inventory.txt."<<endl;
exit(1);
}
inventory_out<<bar<<endl<<chocolate<<endl<<juice<<soda<<endl;
inventory_out.close();
return;
}
void price_changer()
{
cout<<"\nEnter new prices of granola bars, hot chocolates,\n"
<<"juices and sodas:\n";
cin>>price_soda>>price_choc>>price_juice>>price_bar;
price_out.open ("E:\\Ravi\\price.txt");
if (price_out.fail ())
{
cout<<"ERROR cant open price.txt."<<endl;
exit(1);
}
price_out<<price_soda<<endl<<price_choc<<endl<<price_juice<<endl<<price_bar;
price_out.close();
return;
}
void password_changer()
{
cout<<"Enter new 7 character password:\n";
cin>>password;
pout.open ("E:\\Ravi\\password.txt");
if (pout.fail ())
{
cout<<"Error cant open password.txt"<<endl;
exit(1);
}
pout<<password;
pout.close();
return;
}
char settings_menu()
{
char setting_menu()
 
cout<<endl
<<"Select from following\n"
<<"V View till, inventory/price level\n"
<<"T Change till balance\n"
<<"I Change inventory balance\n"
<<"P Change prices\n"
<<"C change password\n"
<<"Enter any other character to exit\n";
cin>>setting_menu;
return setting_menu;
}

k i fixed those errors however after fixing my errors i went from 1 error to 44 heres the code

//File: Assignment 3
//Programmer: Ravi Mandair CPSC 1103 S. 10
//Purpose: To simulate a pop machine
#include <iostream>
#include <string>
#include <cstdlib>
#include <fstream>
#include <cstring>
using namespace std;
char choices(); // purchaser choices
char inventory(); // user selection
char settings_menu(); // maintenance choice
bool check_availability (char, int, int, int, int); //item availability
bool price_match (double, double); //actual money entered/price
bool verify_password (char [8]); // checks correct pass
double change_calculator (double, double); //difference b/w tendered & price
double get_price (double, int&, int&, int&, int&, int&); // enter money and calc total value
string greeter (); // greets user
void apologizer (); // apology if item is out of stock
void changer (double, double, int&, int&, int&, int&, int&); //calcs change if it is more than purchase price
void error_money (); // if less money than purchase price gives error msg
void exiter (string); // thank you msg
void inventory_balance (); // opens inventory log/initalizes
void inventory_update (char, int&, int&, int&, int&);
void new_inventory_balance();
void new_till_balance();
void order_out();
void password_changer();
void prices();
void price_changer();
void price_display (char, double&, double, double, double, double);
void reciept (char);
void till_ballance();
void viewer();
// Variable Declarations
char password[8];
double price_bar;
double price_choc;
double price_juice;
double price_soda;
int nickel_till;
int dime_till;
int quarter_till;
int loonie_till;
int toonie_till;
int bar;
int chocolate;
int juice;
int soda;
ifstream fin, inventory_in, price_in, pin;
ofstream fout, inventory_out, price_out, pout;
int main()
{
//variable declaration
bool availability;
bool check_price;
bool check_password;
char selection;
char purchase_selection;
char setting;
double price;
double money_recieved;
double change;
string name;
till_ballance();
inventory_balance ();
prices();
name = greeter ();
do
{
selection = choices ();
switch (selection)
{
case 'P':
case'p':
if ((nickel_till >=5) && (dime_till >=5) && (quarter_till >=5) && (loonie_till >=5) && (toonie_till >=5))
{
purchase_selection = inventory ();
if (purchase_selection == 'X' || purchase_selection == 'x')
break;
else
availability = check_availability (purchase_selection, bar, chocolate, juice, soda);
if (availability)
{
price_display (purchase_selection, price, price_bar, price_choc, price_juice, price_soda);
money_recieved = get_price (price, nickel_till, dime_till, quarter_till, loonie_till, toonie_till);
check_price = price_match (price, money_recieved);
if (check_price)
{
reciept (purchase_selection);
inventory_update (purchase_selection, bar, chocolate, juice, soda);
}
else
{
change = change_calculator (money_recieved, price);
if (change > 0)
{
changer (money_recieved, change, nickel_till, dime_till, quarter_till, loonie_till, toonie_till);
inventory_update (purchase_selection, bar, chocolate, juice, soda);
}
else
error_money ();
}
}
else
apologizer ();
}
else
order_out();
break;
case 'U':
case 'u':
cout<<"Please enter 7 character password: "<<endl;
cin>>password;
check_password = verify_password (password);
if (check_password)
{
setting = settings_menu();
switch (setting)
{
case 'V':
case 'v':
viewer();
break;
case 'T':
case 't':
new_till_balance();
break;
case 'I':
case 'i':
new_inventory_balance();
break;
case 'P':
case 'p':
price_changer();
break;
case 'C':
case 'c':
password_changer();
break;
default:
cout<<"\nSettings Saved\n";
}
}
else
cout<<"\nNo entry\n";
break;
case 'X':
case 'x':
exiter(name);
break;
default:
cout<<endl
<<"Try again!"<<endl;
}
}while (selection != 'X' && selection != 'x');
cout<<"Written by Ravi Mandair CPSC 1103 S.10"<<endl;
return 0;
}
char inventory ()
{
char menu;
cout<<endl
<<"Please enter a choice\n"
<<"G Granola Bar\n"
<<"H Hot chocolate\n"
<<"J juice\n"
<<"S Soda\n"
<<"X Exit\n";
cin>>menu;
return menu;
}
bool check_availability (char item, int item_1, int item_2, int item_3, int item_4)
{
bool checker;
if ((item == 'G') || (item == 'g') && (item_1 > 0))
checker = true;
if ((item == 'G') || (item == 'g') && (item_1 == 0))
checker = false;
if ((item == 'H') || (item == 'h') && (item_2 > 0))
checker = true;
if ((item == 'H') || (item == 'h') && (item_2 == 0))
checker = false;
if ((item == 'J') || (item == 'j') && (item_3 > 0))
checker = true;
if ((item == 'J') || (item == 'j') && (item_3 == 0))
checker = false;
if ((item == 'S') || (item == 's') && (item_4 > 0))
checker = true;
if ((item == 'S') || (item == 's') && (item_4 == 0))
checker = false;
return checker;
}
void price_display (char inventory_selected, double& price, double price_1, double price_2, double price_3, double price_4)
{
if ((inventory_selected == 'G') || (inventory_selected == 'g'))
{
cout<<"The price is $ "<<price_1<<endl;
price = price_1;
}
if ((inventory_selected == 'H') || (inventory_selected == 'h'))
{
cout<<"The price is $ "<<price_2<<endl;
price = price_2;
}
if ((inventory_selected == 'J') || (inventory_selected == 'j'))
{
cout<<"The price is $ "<<price_3<<endl;
price = price_3;
}
if ((inventory_selected == 'S') || (inventory_selected == 's'))
{
cout<<"The price is $ "<<price_4<<endl;
price = price_4;
}
return;
}
double get_price (double price_item, int& till_n, int& till_d, int& till_q, int& till_l, int& till_t)
{
int nickel;
int dime;
int quarter;
int loonie;
int toonie;
double tendered_monies;
cout<<"\nPlease enter $"<<price_item<<" in N D Q L T: ";
cin>>nickel>>dime>>quarter>>loonie>>toonie;
tendered_monies = ((00.5*nickel) + (.10*dime) + (0.25*quarter) + (1.00*loonie) + (2.00*toonie));
if (tendered_monies >= price_item)
{
till_n = nickel + till_n;
till_d = dime + till_d;
till_q = quarter + till_q;
till_l = loonie + till_l;
till_t = toonie + till_t;
}
fout.open ("E:\\Ravi\\prev_balance.txt");
if (fout.fail ())
{
cout<<"ERROR: cant open prev_balance.txt"<<endl;
return EXIT_FAILURE;
}
fout<<till_n<<endl<<till_d<<endl<<till_q<<endl<<till_l<<endl<<till_t<<endl;
fout.close();
return tendered_monies;
}
bool price_match (double price_of_item, double money_from_user)
{
bool price_checker;
if (price_of_item == money_from_user)
price_checker = true;
else
price_checker = false;
return price_checker;
}
void error_money ()
{
cout<<"\nSorry not enough. Collect change from dispenser"<<endl;
return;
}
double change_calculator (double tendered, double price_item)
{
double change;
if(tendered > price_item)
{
change = tendered - price_item;
cout<<"\nYour change $"<<change<<" is being processed.\n";
}
else 
return -1;
return change;
}
void changer (double tender, double change, int& nickel_t, int& dime_t, int& quarter_t, int& loonie_t, int& toonie_t)
{
int toonie_number, loonie_number, quarter_number, dime_number, nickel_number;
toonie_number = 0;
loonie_number = 0;
quarter_number = 0;
dime_number = 0;
nickel_number = 0;
while ((change >= 2.00) && (toonie_t > toonie_number))
{
change = change - 2.00;
toonie_number++;
toonie_t--;
}
while ((change >= 1.00) && (loonie_t > loonie_number))
{
change = change - 1.00;
loonie_number++;
loonie_t--;
}
while ((change >= 0.25) && (quarter_t > quarter_number))
{
change = change - 0.25;
quarter_number++;
quarter_t--;
}
while ((change >= 0.10) && (dime_t > dime_number))
{
change = change - 0.10;
dime_number++;
dime_t--;
}
while ((change >= 0.05) && (nickel_t > nickel_number))
{
change = change - 0.05;
nickel_number++;
nickel_t--;
}
cout<<"\nCollect your change T L Q D N:\n"
<<toonie_number<<" "<<loonie_number<<" "<<quarter_number<<" "<<dime_number<<" "<<nickel_number<<endl;
fout.open ("E:\\Ravi\\prev.balance.txt"<<endl;
exit(1);
}
fout<<nickel_t<<endl<<dime_t<<quarter_t<<endl<<loonie_t<<endl<<toonie_t<<endl;
fout.close();
return;
}
void reciept (char selection)
{
if ((selection == 'G') || (selection == 'g'))
cout<<"\nCollect Granola bar from dispenser\n";
if ((selection == 'H') || (selection == 'h'))
cout<<"\nCollect Hot Chocolate from dispenser\n";
if ((selection == 'J') || (selection == 'j'))
cout<<"\nCollect juice from dispenser\n";
if ((selection == 'S') || (selection == 's'))
cout<<"\nCollect Soda from dispenser\n";
return;
}
void inventory_update (char selection_inventory, int& item_1, int& item_2, int& item_3, int& item_4)
{
if (( selection_inventory == 'G' || (selection_inventory == 'g'))
item_1--;
if (( selection_inventory == 'H' || (selection_inventory == 'h'))
item_2--;
if (( selection_inventory == 'J' || (selection_inventory == 'j'))
item_3--;
if (( selection_inventory == 'S' || (selection_inventory == 's'))
item_4--;

inventory_out.open ("E:\\Ravi\\inventory.txt");
if (inventory_out.fail ())
{
cout<<"ERROR cant open inventory.txt."<<endl;
exit (1);
}
inventory_out<<item_1<<endl<<item_2<<endl<<item_3<<endl<<item_4<<endl;
inventory_out.close();
reutrn;
}
void apologizer ()
{
cout<<"\nSorry Out of Stock.\n";
return;
}
void exiter (string user)
{
cout<<endl
<<"Thank you for using the Pop Machine,\n"
<<"have a nice day, "<<user<<"."<<endl;
return;
}
char choices ()
{
char select;
cout<<endl
<<"Select an option:\n"
<<"P Purchase\n"
<<"U Update till/inventory\n"
<<"X Exit\n"
cin>>select;
return select;
}
void order_out()
{
cout<<"\n Out of Order\n";
return ;
}
string greeter ()
{
string namer;
cout<<"Welcome to the Pop Machine\n"
<<"Enter your name:\n";
cin>>namer;
return namer;
}
void till_balance()
{
fin.open ("E:\\Ravi\\prev_balance.txt");
if (fin.fail())
{
cout<<"ERROR cant open prev_balance.txt."<<endl;
exit (1);
}
fin>>nickel_till>>dime_till>>quarter_till>>loonie_till>>toonie_till;
fin.close();
return;
}
void inventory_balance ()
{
inventory_in.open ("E:\\Ravi\\inventory.txt");
if (inventory_in.fail) ())
{
cout<<"ERROR cant open inventory.txt."<<endl;
exit (1);
}
inventory_in>>bar>>chocolate>>juice>>soda;
inventory_in.close();
return;
}
void prices()
{
price_in.open ("E:\\Ravi\\price_in.txt");
if (price_in.fail) ())
{
cout<<"ERROR cant open price_in.txt."<<endl;
exit (1);
}
price_in>>price_bar>>price_choc>>price_juice>>price_soda;
price_in.close();
return ;
}
bool verify_password (char entered_password[8])
{
bool verify;
car set_password[8];
pin.open ("E:\\Ravi\\password.txt");
if (pin.fail) ())
{
cout<<"ERROR cant open password.txt."<<endl;
exit (1);
}
pin>>set_password;
pin.close();
if(strcmp(set_password, entered_password))
verify = false;
else
verify = true;
return verify;
}
void viewer()
{
till_balance();
inventory_balance ();
prices();
cout<<"\nThe number of coins in till are N D Q L T:\n"
<<nickel_till<<" "<<dime_till<<" "<<quarter_till<<" "<<loonie_till<<" "<<toonie_till;
cout<<"\nNumber of granola bars, hot chocolate, juices and sodas are :\n"
<<bar<<" "<<chocolate<<" "<<juices<<" "<<soda<<" accordingly.\n";
cout<<"\nThe prices are:\n"
<<"granola bar $"<<price_bar<<endl
<<"hot_chocolate $"<<price_choc<<endl
<<"juice $"<<price_juice<<endl
<<"soda $<<price_soda<<endl;
return;
}
void new_till_balance()
{
cout<<"\nPlease enter the number of N D Q L T:\n";
cin>>nickel_till>>dime_till>>quarter_till>>loonie_till>>toonie_till;
fout.open ("E:\\Ravi||prev_balance.txt");
if (fout.fail ())
{
cout<<"Error cant open prev_balance.txt."<<endl;
exit(1);
}
fout<<nickel_till<<endl<<dime_till<<endl<<quarter_till<<endl<<loonie_till<<endl<<toonie_till;
fout.close();
return;
}
void new_inventory_balance()
{
cout<<"\nEnter number of granola bars , hot chocolate, juices and sodas:\n";
cin>>bar>>chocolate>>juice>>soda;
inventory_out.open ("E:\\Ravi\\inventory.txt");
if (inventory_out.fail ())
{
cout<<"ERROR cant open inventory.txt."<<endl;
exit(1);
}
inventory_out<<bar<<endl<<chocolate<<endl<<juice<<soda<<endl;
inventory_out.close();
return;
}
void price_changer()
{
cout<<"\nEnter new prices of granola bars, hot chocolates,\n"
<<"juices and sodas:\n";
cin>>price_soda>>price_choc>>price_juice>>price_bar;
price_out.open ("E:\\Ravi\\price.txt");
if (price_out.fail ())
{
cout<<"ERROR cant open price.txt."<<endl;
exit(1);
}
price_out<<price_soda<<endl<<price_choc<<endl<<price_juice<<endl<<price_bar;
price_out.close();
return;
}
void password_changer()
{
cout<<"Enter new 7 character password:\n";
cin>>password;
pout.open ("E:\\Ravi\\password.txt");
if (pout.fail ())
{
cout<<"Error cant open password.txt"<<endl;
exit(1);
}
pout<<password;
pout.close();
return;
}
char settings_menu()
{
char setting_menu()

cout<<endl
<<"Select from following\n"
<<"V View till, inventory/price level\n"
<<"T Change till balance\n"
<<"I Change inventory balance\n"
<<"P Change prices\n"
<<"C change password\n"
<<"Enter any other character to exit\n";
cin>>setting_menu;
return setting_menu;
}

k i fixed those errors however after fixing my errors i went from 1 error to 44 heres the code

That's because of the error below.

First error:

usingnamespace std;

Closing parentheses missing (and why the heck are you using << endl; ?):

fout.open ("E:\\Ravi\\prev.balance.txt"<<endl;

Only errors I can see.

Also, haven't youe ever heard of formatting your code? It's unreadable without proper indentation.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.