Está en la página 1de 4

Colegio Preuniversitario Cambridge

Nombre: Luis David Mérida Recinos


Grado: 6to. Perito Contador
Sección: Única
Profesor: Osvin
Curso: Programación

Tema:
Programa Restaurante

Fecha: 29/09/2022
Huehuetenango
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
#include <windows.h>
#include <string>
main(){
string datos[3];
string productos[5]={"Flauta", "Churrasco", "Cafe", "Pizza", "Hamburguesa"};
int opc, restaurante,compras, can, canv;
int existencias[5][2]={{25, 100}, {35, 300}, {15, 200}, {50, 150}, {55, 80}};
int Existencia;
int i,j=0;

cout<<"+++ R E S T A U R A N T E +++"<<endl<<endl;
cout<<"Ingrese la siguiente informacion"<<endl<<endl;
cout<<"Ingrese su nombre: ";
cin>>datos[0];
cout<<"Ingrese el numero de mesa: ";
cin>>datos[1];
cout<<"Ingrese su nit: ";
cin>>datos[2];

Inicio:
cout<<"+++ R E S T A U R A N T E +++"<<endl;
cout<<"1. COMPRAS "<<endl;
cout<<"2. HISTORIAL "<<endl;
cout<<"3. SALIR "<<endl;
cout<<"Eliga la opcion que desea: ";
cin>>opc;

switch(opc)
{
case 1:
compras:
system("cls");
cout<<"+++ M E N U +++"<<endl;
cout<<"1. "<<productos[0]<<endl;
cout<<"2. "<<productos[1]<<endl;
cout<<"3. "<<productos[2]<<endl;
cout<<"4. "<<productos[3]<<endl;
cout<<"5. "<<productos[4]<<endl;
cout<<"6. - REGRESAR -"<<endl;
cout<<""<<endl;
cout<<"Ingrese el producto que desea comprar: ";
cin>>compras;
cout<<""<<endl;
cout<<""<<endl;
switch(compras){
case 1:
cout<<"+++COMPRA DE "<<productos[0]<<" -----"<<endl;
cout<<"Cuantas desea comprar: ";
cin>>can;
existencias[0][1]=existencias[0][1]+can;
cout<<"COMPRA REALIZADA";
getch();
goto compras;
break;
case 2:
cout<<"+++COMPRA DE "<<productos[1]<<" -----"<<endl;
cout<<"Cuantos desea comprar: ";
cin>>can;
existencias[1][1]=existencias[1][1]+can;
cout<<"COMPRA REALIZADA";
getch();
goto compras;
break;
case 3:
cout<<"+++COMPRA DE "<<productos[2]<<" -----"<<endl;
cout<<"Cuantos desea comprar: ";
cin>>can;
existencias[2][1]=existencias[2][1]+can;
cout<<"COMPRA REALIZADA";
getch();
goto compras;
break;
case 4:
cout<<"+++COMPRA DE "<<productos[3]<<"-----"<<endl;
cout<<"Cuantas desea comprar: ";
cin>>can;
existencias[3][1]=existencias[3][1]+can;
cout<<"COMPRA REALIZADA";
getch();
goto compras;
break;
case 5:
cout<<"+++COMPRA DE "<<productos[4]<<" -----"<<endl;
cout<<"Cuantas desea comprar: ";
cin>>can;
existencias[4][1]=existencias[4][1]+can;
cout<<"COMPRA REALIZADA";
getch();
goto compras;
break;
case 6:
clrscr();
goto Inicio;
break;
}

case 2:
Existencia:
system("cls");
cout<<"+++ H I S T O R I A L +++"<<endl;
for (j=0;j<=4;i++)
{
cout<<"- -"<<existencias[j][0]<<"--"<<existencias[j][1]<<"- -"<<existencias[j][2]<<"-
-"<<existencias[j][3]<<"- -"<<existencias[j][4]<<endl;
cout<<""<<endl;
}
goto Inicio;
break;

case 4:
system("cls");
clrscr();
for(int i=3; i>=0; i--){
gotoxy(12,6);
cout<<"----- F I N -----"<<endl;
Sleep(1000);
}
exit(3);
break;
}
getch();
}

También podría gustarte