You are on page 1of 5

#include <iostream>

#include <fstream>
#include <stack>
#include <stdlib.h>
#include <windows.h>
#include "vector.h"

using namespace std;

ifstream fin("adresa.in");
ofstream fout("adresa.in");

struct apl{
float pret;
struct timp{
unsigned ora,minute;
}t;
}kfc[101],msp[101],prm[101];

stack<int>s;
int balanta;

void r1(stack<int>&s);
void r2(stack<int>&s);
void r3(stack<int>&s);
void opt2(stack<int>&s);
void opt12(stack<int>&s);
void opt11(stack<int>&s);
void inapoi(stack<int>&s);

void ordonarepret(apl v[]){


int ok1,ok2,ok3;
do{
ok1=0;
for(int i=0;i<5;++i)
{
if(v[i].pret>v[i+1].pret)
{
swap(v[i],v[i+1]);
ok1=1;
}
}
}
while(ok1==1);
}

void opt1(stack<int>&s){
int optiune=0;
s.push(1);
system("CLS");
cout<<"Alegeti optiunea :"<<endl;
cout<<endl;
cout<<" ~1.Balanta contului~"<<endl;
cout<<" ~2.Introduceti bani~"<<endl;
cout<<" ~3.Inapoi~"<<endl;
cout<<endl;
cout<<"Optiunea dumneavoastra : ";cin>>optiune;
if(optiune==1) opt11(s);
else if(optiune==2) opt12(s);
else inapoi(s);
}

void opt11(stack<int>&s){
int optiune=0;
s.push(11);
system("CLS");
cout<<"Balanta dumneavoastra este : "<<balanta<<endl;
cout<<endl;
cout<<"Alegeti optiunea :"<<endl;
cout<<endl;
cout<<" ~1.Introduceti balanta~"<<endl;
cout<<" ~2.Inapoi~"<<endl;
cout<<endl;
cout<<"Optiunea dumneavoastra : ";cin>>optiune;
if(optiune==1) opt12(s);
else inapoi(s);
}

void opt12(stack<int>&s){
int optiune=0,x;
s.push(12);
system("CLS");
cout<<"Suma dorita : ";cin>>x;
balanta+=x;
system("CLS");
cout<<"Actiune in procesare..."<<endl;
Sleep(1);
system("CLS");
cout<<"Tranzactie reusita"<<endl;
cout<<endl;
cout<<"Alegeti optiunea :"<<endl;
cout<<endl;
cout<<" ~1.Inapoi~"<<endl;
cout<<endl;
cout<<"Optiunea dumneavoastra : ";cin>>optiune;
if(optiune==1) inapoi(s);
}

void opt2(stack<int>&s){
int optiune=0;
s.push(2);
system("CLS");
cout<<"Selectati restaurantul :"<<endl;
cout<<endl;
cout<<" ~1.KFC"<<endl;
cout<<" ~2.Mesopotamia"<<endl;
cout<<" ~3.Pravalia lui Mihai"<<endl;
cout<<" ~4.Inapoi"<<endl;
cout<<endl;
cout<<"Optiunea dumneavoastra : ";cin>>optiune;
}

void opt21(stack<int>&s)
{
system("CLS");
cout<<"Meniul restaurantului este :"<<endl;
cout<<endl;
cout<<" 1.Meniu Crispy Meltz";
kfc[0].pret=27.5;
kfc[0].t.ora=0;
kfc[0].t.minute=45;
cout<<" 2.Meniu Crispy Strips"<<endl;
kfc[1].pret=35;
kfc[1].t.ora=1;
kfc[1].t.minute=10;
cout<<" 3.American bucket"<<endl;
kfc[2].pret=47.5;
kfc[2].t.ora=1;
kfc[2].t.minute=35;
cout<<" 4.Meniu Dublu Booster"<<endl;
kfc[3].pret=25;
kfc[3].t.ora=0;
kfc[3].t.minute=45;
cout<<" 5.Greek Salad"<<endl;
kfc[4].pret=21.5;
kfc[4].t.ora=0;
kfc[4].t.minute=30;
cout<<endl;
cout<<"~Inapoi~";
}

void opt22(stack<int>&s)
{

system("CLS");
cout<<"Meniul restaurantului este :"<<endl;
cout<<endl;
cout<<" 1.Roll Kebab"<<endl;
msp[0].pret=17.5;
msp[0].t.ora=0;
msp[0].t.minute=35;
cout<<" 2.Meniu Donner"<<endl;
msp[1].pret=30;
msp[1].t.ora=1;
msp[1].t.minute=15;
cout<<" 3.Pizza Kebab"<<endl;
msp[2].pret=17.5;
msp[2].t.ora=2;
msp[2].t.minute=10;
cout<<" 4.Salata Kebab"<<endl;
msp[3].pret=22.5;
msp[3].t.ora=0;
msp[3].t.minute=45;
cout<<" 5.Clatite cu dulceata"<<endl;
msp[4].pret=15;
msp[4].t.ora=0;
msp[4].t.minute=25;
cout<<endl;
cout<<"~Inapoi~";
}

void opt23(stack<int>&s)
{

system("CLS");
cout<<" 1.Crispy"<<endl;
prm[0].pret=23.5;
prm[0].t.ora=1;
prm[0].t.minute=15;
cout<<" 2.Burger Royal"<<endl;
prm[1].pret=32.5;
prm[1].t.ora=1;
prm[1].t.minute=25;
cout<<" 3.Burger Black Angus"<<endl;
prm[2].pret=45;
prm[2].t.ora=2;
prm[2].t.minute=20;
cout<<" 4.Pizza Casei"<<endl;
prm[3].pret=37.5;
prm[3].t.ora=1;
prm[3].t.minute=45;
cout<<" 5.Platou Traditional"<<endl;
prm[4].pret=140;
prm[4].t.ora=2;
prm[4].t.minute=45;
cout<<endl;
cout<<"~Inapoi~";
}
void meniup(stack<int>&s){
int optiune=0;
s.push(10);
system("CLS");
cout<<"Alegeti optiunea :"<<endl;
cout<<endl;
cout<<" ~1.Contul meu~"<<endl;
cout<<" ~2.Selectati restaurantul~"<<endl;
cout<<" ~3.Iesire~"<<endl;
cout<<endl;
cout<<"Optiunea dumneavoastra : ";cin>>optiune;
if(optiune==1) opt1(s);
else if(optiune==2) opt2(s);
else{

}
}

void inapoi(stack<int>&s){
s.pop();
system("CLS");
int x=s.top();
if(x==1) opt1(s);
else if(x==11) opt11(s);
else if(x==12) opt12(s);
else if(x==10) meniup(s);
}

int main()
{
meniup(s);
return 0;
}

You might also like