pide ingresar personas, sacar personas. el de ingresar debe tener sala de espera.
Publicado por Restaurante (1 intervención) el 17/11/2022 23:44:34
#include <iostream>
using namespace std;
int opc, m1[4][10],m2[6][6],m3[10][4],per,z=1,x=0,y=0,m=10,l=6,t=4,v1=0,v2=0,v3=0;
void ingre(){
cout<<"Mesas disponibles "<<m<<endl;
cout<<"ingresa el numero de personas: ";
cin>>per;
if(per<=4){
for(int y=0;y<per;y++){
m3[x][y]=z;
}
v1=v1+1;
m=m-1;
}
else{
if(per>4 && per<=6){
for(int y=0;y<per;y++){
m2[x][y]=z;
}
v2=v2+1;
l=l-1;
}
else{
if(per>6 && per<=10){
for(int y=0;y<per;y++){
m1[x][y]=z;
}
v3=v3+1;
t=t-1;
}
}
}
}
void mostrar(){
for(int x=0; x<10; x++){
for(int y=0;y<4;y++){
cout<<m3[x][y];
}
cout<<"\n";
}
for(int x=0; x<6; x++){
for(int y=0;y<6;y++){
cout<<m2[x][y];
}
cout<<"\n";
}
for(int x=0; x<4; x++){
for(int y=0;y<10;y++){
cout<<m1[x][y];
}
cout<<"\n";
}
cout<<""<<endl;
system("pause");
system("cls");
}
void sali()
{
cout<<"Ingresa mesa que quieres sacar: ";
cin>>per;
}
void fin()
{
cout<<"cerrando programa"<<endl;
}
void opn()
{
cout<<"\n\nopcion no valida\n\n"<<endl;
system("pause");
system("cls");
}
int main(){
do{
cout<<"1.-ingresar\n2.-salidas\n3.-mostrar\n4.-salir\n\n**elige una opcion**: ";
cin>>opc;
switch(opc){
case 1:
ingre();
break;
case 2:
;
break;
case 3:
mostrar();
break;
case 4:
fin();
break;
default:
opn();
break;
}
}while(opc!=4);
}
using namespace std;
int opc, m1[4][10],m2[6][6],m3[10][4],per,z=1,x=0,y=0,m=10,l=6,t=4,v1=0,v2=0,v3=0;
void ingre(){
cout<<"Mesas disponibles "<<m<<endl;
cout<<"ingresa el numero de personas: ";
cin>>per;
if(per<=4){
for(int y=0;y<per;y++){
m3[x][y]=z;
}
v1=v1+1;
m=m-1;
}
else{
if(per>4 && per<=6){
for(int y=0;y<per;y++){
m2[x][y]=z;
}
v2=v2+1;
l=l-1;
}
else{
if(per>6 && per<=10){
for(int y=0;y<per;y++){
m1[x][y]=z;
}
v3=v3+1;
t=t-1;
}
}
}
}
void mostrar(){
for(int x=0; x<10; x++){
for(int y=0;y<4;y++){
cout<<m3[x][y];
}
cout<<"\n";
}
for(int x=0; x<6; x++){
for(int y=0;y<6;y++){
cout<<m2[x][y];
}
cout<<"\n";
}
for(int x=0; x<4; x++){
for(int y=0;y<10;y++){
cout<<m1[x][y];
}
cout<<"\n";
}
cout<<""<<endl;
system("pause");
system("cls");
}
void sali()
{
cout<<"Ingresa mesa que quieres sacar: ";
cin>>per;
}
void fin()
{
cout<<"cerrando programa"<<endl;
}
void opn()
{
cout<<"\n\nopcion no valida\n\n"<<endl;
system("pause");
system("cls");
}
int main(){
do{
cout<<"1.-ingresar\n2.-salidas\n3.-mostrar\n4.-salir\n\n**elige una opcion**: ";
cin>>opc;
switch(opc){
case 1:
ingre();
break;
case 2:
;
break;
case 3:
mostrar();
break;
case 4:
fin();
break;
default:
opn();
break;
}
}while(opc!=4);
}
Valora esta pregunta
0