POS with inventory

Im writing a program that has point of sale and I would like to have Inventory control at POS here is my code so far there is alot missing with my menus and such just getting it all filled in, Im trying to figure out how to integrate taking out of inventory each ingredient I use, say for example I sell a hamburger when I select hamburger I want it to take buns and meat out when I select it. Then ill have another submenu that selects extras like pickles and such, I want it to subtract from inventory what I select any help will be great....
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <cmath>
#include <ctime>
#include <conio.h>

using namespace std;

void display_menu();
void display_breakfast();
void display_lunch();
void display_dinner();
void tax(float);
float total = 0;

int main() {
char tchoice, bchoice, lchoice, dchoice ;
char time = true;
bool meal = true;
bool breakfast = true;
bool lunch = true;

cout << setiosflags(ios::showpoint) << setiosflags(ios::fixed) << setprecision(2);

while(time) {
cout << "Enter meal time here" << endl;
time;
cout << "Please enter the selection for type of meal: ";
cin >> tchoice;
switch (tchoice) {

case 'B':
case 'b':
cout << "Breakfast Served 6 A.M. - 11 A.M.: ";
if (time = 'b')
goto breakfast;


case 'L':
case 'l':
cout << "Lunch Served from 11 A.M. - 4 P.M.: ";
if (time = 'l')
goto lunch;
}
}

breakfast:
while(breakfast) {
cout << " Welcome to Breakfast menu" << endl;
display_breakfast();
cout << "Please enter meal selection letter: ";
cin >> bchoice;
switch (bchoice) {
}
}
lunch:
while(lunch) {
cout << "Welcome to Joe Schmoe's Diner" << endl;
display_lunch();
cout << "Please enter the meal selection letter: ";
cin >> lchoice;
switch (lchoice) {

case 'S':
case 's':
cout << "Sandwich - $3.00" << endl;
total+=3;
break;
case 'C':
case 'c':
cout << "Chips - $0.50" << endl;
total+=0.50;
break;
case 'P':
case 'p':
cout << "Popcorn - $0.50" << endl;
total+=.50;
break;
case 'H':
case 'h':
cout << "Hotdog - $2.50" << endl;
total+=2.50;
break;
case 'C':
case 'c':
cout << "Coke - $1.00" << endl;
total+=1;
display_menu();
break;
case 'B':
case 'b':
cout << "Burger - $5.00" << endl;
total+=5;
break;
case 'X' :
case 'x':
cout << "Canceled--Please start over." << endl;
total = 0;
break;
case 'T' :
case 't':
tax(total);
meal = false;
system("pause");
return 0;
break;
default:
cout << "Error please re-enter selection :";
return 0;
}
cout << "Your current total is: $ "<< total << "\n\n";
}
return 0;
}




void display_lunch() {
cout << endl;
cout << "S - Sandwich 3.00" << endl;
cout << "C - Chips 0.50" << endl;
cout << "P - Popcorn 0.50" << endl;
cout << "H - Hotdog 2.50" << endl;
cout << "D - Coke 1.00" << endl;
cout << "B - Burger 5.00" << endl;
cout << "X - Cancel sale and start over" << endl;
cout << "T - Total the sale" << endl;
cout << "All items have additional 7% tax." << endl;
}


void tax(float total) {
cout << endl;
cout << "Sub-total: " << total << endl;
cout << "+ Tax : " << total*0.07 << endl;
cout << "Total : " << total + (total*0.07) << endl;
}
Topic archived. No new replies allowed.