• Jueves 28 de Marzo de 2024, 10:50

Autor Tema:  por favor.tengo varios errores  (Leído 2468 veces)

YOSOYUNPRO

  • Nuevo Miembro
  • *
  • Mensajes: 1
    • Ver Perfil
por favor.tengo varios errores
« en: Miércoles 19 de Julio de 2017, 16:50 »
0
program restaurant;

uses crt;
  //DECLARACIÓN DE CONSTANTES//
const
                          //precios de los productos//

            pre_hp_s =5000;                 //Precio de hamburgueza de pollo simple
            pre_hp_d =6000;                 //precio de hamburgueza de pollo doble
            pre_hc_s=4500;                  //precio de hamburgueza de carne simple
            pre_hc_d =5500;                 //precio de hamburgueza de carne doble
            pre_h_mixta=7000;               //precio de hamburgueza mixta
            pre_pc_n=2000;                  //precio de perro caliente normal
            pre_pc_j=3500;                  //precio de perro caliente jumbo
            pre_refresco=1500;              //precio de refresco
            pre_t_limon=1000;               //precio de te con limon
            pre_agua_mi=1000;               //precio de agua mineral
           
                         //Nombre de los productos//
            hp_s='Hamburgueza de pollo simple';
            hp_d='Hamburgueza de pollo doble';
            hc_s='Hamburgueza de carne simple';
            hc_d='Hamburgueza de carne doble';
            h_mixta='Hamburgueza mixta';
            pc_normal='Perro caliente normal';
            pc_jumbo='Perro caliente jumbo';
            refresco='Refresco';
            t_limon='Te con limon';
            agua='Agua mineral';
   //DECLARACIÓN DE VARIABLES//
var
            totalv:integer;                 //Dinero total de las ventas
           
            cont_totalv:integer;            //contador de las ventas
           
         cuenta_clien:integer;           //Cuenta a pagar por cada cliente
           
            totalv_hps:integer;             //Dinero total de hamburguezas de pollo simples vendidas
           
            cont_hps:integer;               //Cantidad de hamburguezas de pollo simples por cliente
           
            contotal_hps:integer;           //Cantidad total de hamburguezas de pollo simples vendidas
           
            totalv_hpd:integer;             //Dinero total de hamburguezas de pollo dobles
           
            cont_hpd:integer;               //Cantidad de hamburguezas de pollo doble por cliente
           
            contotal_hpd:integer;          //Cantidad total de hamburguezas de pollo dobles vendidas
           
            totalv_hcs:integer;             //Dinero total de hamburguezas de carne simples vendidas
           
            cont_hcs:integer;              //Cantidad de hamburguezas de carne simples por cliente
           
            contotal_hcs:integer;          //Cantidad total de hamburguezas de carne simples vendidas
           
            totalv_hcd:integer;             //Dinero total de hamburguezas de carne dobles vendidas
           
            cont_hcd:integer;              //Cantidad de hamburguezas de carne dobles por cliente
           
            contotal_hcd:integer;          //Cantidad total de hamburguezas de carne simples vendidas
           
            totalv_h_mix:integer;           //Dinero total de hamburguezas mixtas vendidas
           
            cont_h_mix:integer;             //Cantidad de hamburguezas mixtas por cliente
           
            cont_hamb:integer;              //Contador de todas las hamburguezas
           
            contotal_mix:integer;           //Cantidas de hamburguezas mixtas vendidas
           
            totalv_pcn:integer;             //Dinero total de perro calinte normal vendidos
           
            cont_pcn:integer;               //Cantidad de perros calientes normales por cliente
           
            contotal_pcn:integer;           //Cantidad total de perros calientes normales vendidos
           
            totalv_pcj:integer;             //Dinero total de perros calientes jumbo vendidos
           
            cont_pcj:integer;               //Cantidad de perros calientes jumbo por cliente
           
            contotal_pcj:integer;           //Cantidad total de perros calientes jumbo vendidos
           
            totalv_ref:integer;            //Dinero total de refrescos vendidos
           
            cont_refres:integer;           //Cantidad de refrescos por cliente
           
            contotal_ref:integer;          //Cantidad total de refrescos vendidos
           
            totalv_te:integer;             //Dinero total de té con limón vendido
           
            cont_te:integer;               //Cantidad de té con limón por cliente
           
            contotal_te:integer;           //Cantidad total de té con limón vendido
           
            totalv_agua:integer;           //Dinero total de agua mineral vendida
           
            cont_agua:integer;             //Cantidad de agua mineral por cliente
           
            contotal_agu:integer;          //Cantidad total de té con limón vendido
           
            cont_client:integer;           //contador de clientes
           
            client_desc:integer;           //contador de clientes con descuento
           
            totalv_desc:integer;           //contador de ventas con descuento
           
            opc:integer;                   //Opcion del menú principal
           
            Opc1:integer;                  //Opcion del menú secundario
           
            n_productos:integer;             //numero de productos que pide el cliente
           
            pedido:string[40];               //nombre del producto
           
            precio:integer;                  //precio del producto
           
            resp2:string[2];
           
            resp:string[2];                  //Respuesta (desea llevar otro producto?)
            a:integer;                       //contador de catidad de productos
           
            b,c,x,y:integer;                        //contadores y opciones
            descuento:integer;
           
BEGIN
                             //INICIALIZACION DE VARIABLES//
           
   totalv:=0;                                 
   cont_totalv:=0;
                      
   totalv_hps:=0;
   cont_hps:=0;
   contotal_hps:=0;
   
   totalv_hpd:=0;
   cont_hpd:=0;
   contotal_hpd:=0;
   
   totalv_hcs:=0;
   cont_hcs:=0;
   contotal_hcs:=0;
   
   totalv_hcd:=0;
   cont_hcd:=0;
   contotal_hcd:=0;
   
   client_desc:=0;
   totalv_desc:=0;
            
   totalv_h_mix:=0;
   cont_h_mix:=0;
   contotal_mix:=0;
   
   totalv_pcn:=0;
   cont_pcn:=0;
   contotal_pcn:=0;
   
   totalv_pcj:=0;
   cont_pcj:=0;
   contotal_pcj:=0;
   
   totalv_ref:=0;
   cont_refres:=0;
   contotal_ref:=0;
   
   totalv_te:=0;
   cont_te:=0;
   contotal_te:=0;
   
   totalv_agua:=0;
   cont_agua:=0;
   contotal_agu:=0;
   
   cont_client:=0;
   cont_hamb:=0;
   descuento:=0;
   writeln('Bienvenido al sistema de ventas');
   opc:=0;
   resp2:='oo';

repeat
   writeln('seleccione una opcion');
   write;
   writeln('1._Hacer un proceso de ventas');
   writeln('2._Visualizar los reportes de ventas');
   writeln('3._Salir');
   readln(opc);
if (opc<1) or (opc>3) then
begin
   writeln('Opcion inválida');
end;
   until (opc>=1) and  (opc<=3);
   repeat

case opc of

1:begin
   opc1:=0;
   cont_client:=cont_client+1;
   cuenta_clien:=0;
   resp:='oo';
repeat

repeat



   writeln('Seleccione uno por uno los productos y la cantidad que desea llevar');
   write;
   writeln('1._Hamburgueza de pollo simple');
   writeln('2._Hamburgueza de pollo doble');
   writeln('3._Hamburgueza de carne simple');
   writeln('4._Hamburgueza de carne doble');
   writeln('5._Hamburgueza mixta');
   writeln('6._Perro caliente normal');
   writeln('7._Perro caliente jumbo');
   writeln('8._Refresco');
   writeln('9._Té con limón');
   writeln('10._Agua mineral');
   readln(opc1);
if (opc1<1) or (opc1>10) then
begin
   writeln('Opcion inválida');
end;
until(opc1>=1) and (opc1<=10);
case opc1 of

1: begin
   writeln('Cuantas hamburguezas de pollo simples desea llevar?');
   readln(cont_hps);
   cont_hamb:=cont_hamb+cont_hps;
   cuenta_clien:=cuenta_clien+(cont_hps*pre_hp_s);
   contotal_hps:=contotal_hps+cont_hps;
   totalv_hps:=totalv_hps+cont_hps*pre_hp_s;
   
   end;
2:begin
   writeln('Cuantas hamburguezas de pollo dobles desea llevar?');
   readln(cont_hpd);
   cont_hamb:=cont_hamb+cont_hpd;
   cuenta_clien:=cuenta_clien+(cont_hps*pre_hp_d);
   contotal_hpd:=contotal_hpd+cont_hpd;
   totalv_hpd:=totalv_hpd+cont_hpd*pre_hp_d;
   end;
3:begin
   writeln('Cuantas hamburguezas de carne simples desea llevar?');
   readln(cont_hcs);
   cont_hamb:=cont_hamb+cont_hcs;
   cuenta_clien:=cuenta_clien+(cont_hcs*pre_hc_s);
   contotal_hcs:=contotal_hcs+cont_hcs;
   totalv_hcs:=totalv_hcs+cont_hcs*pre_hc_s;
   end;
4:begin
   writeln('Cuantas hamburguezas de carne dobles desea llevar?');
   readln(cont_hcd);
   cont_hamb:=cont_hamb+cont_hcd;
   cuenta_clien:=cuenta_clien+(cont_hcd*pre_hc_d);
   contotal_hcd:=contotal_hcd+cont_hcd;
   totalv_hcd:=totalv_hcd+cont_hcd*pre_hc_d;
   end;
5:begin
   writeln('Cuantas hamburguezas mixtas desea llevar?');
   readln(cont_h_mix);
   cont_hamb:=cont_hamb+cont_h_mix;
   cuenta_clien:=(cont_h_mix*pre_h_mixta)+cuenta_clien;
   contotal_mix:=contotal_mix+cont_h_mix;
   totalv_h_mix:=totalv_h_mix+cont_h_mix*pre_h_mixta;
   end;
6:begin
   writeln('Cuantos perros calientes normales desea llevar?');
   readln(cont_pcn);
   cuenta_clien:=cuenta_clien+(cont_pcn*pre_pc_n);
   contotal_pcn:=contotal_pcn+cont_pcn;
   totalv_pcn:=totalv_pcn+cont_pcn*pre_pc_n;
   end;
7:begin
   writeln('Cuantos perros calientes jumbo desea llevar?');
   readln(cont_pcj);
   cuenta_clien:=cuenta_clien+(cont_pcj*pre_pc_j);
   contotal_pcj:=contotal_pcj+cont_pcj;
   totalv_pcj:=totalv_pcj+cont_pcj*pre_pc_j;
   end;
8:begin
   writeln('Cuantos refrescos desea llevar?');
   readln(cont_refres);
   cuenta_clien:=cuenta_clien+(cont_refres*pre_refresco);
   contotal_ref:=contotal_ref+cont_refres;
   totalv_ref:=totalv_ref+cont_refres*pre_refresco;
   end;
9:begin
   writeln('Cuantos té con limón desea llevar');
   readln(cont_te);
   cuenta_clien:=cuenta_clien+(cont_te*pre_t_limon);
   contotal_te:=contotal_te+cont_te;
   totalv_te:=totalv_te+cont_te*pre_t_limon;
   end;
10:begin
   writeln('Cuanta agua mineral desea llevar?');
   readln(cont_agua);
   cuenta_clien:=cuenta_clien+(cont_agua*pre_agua_mi);
   contotal_agu:=contotal_agu+cont_agua;
   totalv_agua:=totalv_agua+cont_agua*pre_agua_mi;
   end;
   end;
   
   writeln('Desea llevar otro producto?');
   readln(resp);
   until(resp='no')or(resp='NO');
clrscr;
writeln;
   write('Cliente N°',cont_client);
   writeln;
   writeln('Producto                             Cantidad                      Monto');
   if cont_hps>0 then
   begin
   writeln;
   writeln(hp_s,'                  '          ,cont_hps,'       ','x', '            ',pre_hp_s   );
   end;
   if cont_hpd>0 then
   begin
   writeln;
   writeln(hp_d,'                   '          ,cont_hpd,'       ','x', '            ',pre_hp_d);
   end;
   if cont_hcs>0 then
   begin
   writeln;
   writeln(hc_s,'                  '          ,cont_hcs,'       ', 'x','            ',pre_hc_s);
   end;
   if cont_hcd>0 then
   begin
   writeln;
   writeln(hc_d,'                   '          ,cont_hcd,'       ','x','            ',pre_hc_d);
   end;
   if cont_h_mix>0 then
   begin
   writeln;
   writeln(h_mixta,'                            ',cont_h_mix,'       ','x','            ',pre_h_mixta);
   end;
   if cont_pcn>0 then
   begin
   writeln;
   writeln(pc_normal,'                        ' ,cont_pcn, '       ','x','            ',pre_pc_n);
   end;
   if cont_pcj>0 then
   begin
   writeln;
   writeln(pc_jumbo,'                         ',cont_pcj, '       ','x','            ',pre_pc_j);
   end;
   if cont_refres>0 then
   begin
   writeln;
   writeln(refresco,'                                     ',cont_refres,'       ','x','            ',pre_refresco);
   end;
   if cont_te>0 then
   begin
   writeln;
   writeln(t_limon,'                                 ',cont_te,'       ','x','            ',pre_t_limon);
   end;
   if cont_agua>0 then
   begin
   writeln;
   writeln(agua,'                                 ',cont_agua,'       ','x','            ',pre_agua_mi);
   end;
   
writeln('________________________________________________________________________________');
writeln('                                                           ''Monto Bs.:',cuenta_clien);
if cont_hamb>6 then
begin
client_desc:=client_desc+1;
descuento:=(cuenta_clien*15)div 100;
writeln('                                                 ''Monto descuento Bs.:',descuento);
writeln('                                                     ''Monto total Bs.:',cuenta_clien-descuento);
totalv_desc:=totalv_desc+(cuenta_clien-descuento);

end
else
begin
totalv:=totalv+cuenta_clien;
end;

end;
end;
writeln('Desea realizar otra venta?');
readln(resp2);
if (resp2<>'si') or (resp2<>'SI') OR (resp2<>'no') or (resp2<>'NO') then
begin
writeln('Respuesta incorrecta');
end;
until (resp2='no') or (resp2='NO')

2:begin
clrscr;
writeln('Se atiendieron ',cont_client,' clientes');
writeln('Se les hizo descuento a ',client_desc,' clientes');
writeln;
writeln('Total de bolivares por venta de hamburguezas de pollo simples: ',totalv_hps);
writeln('Total de bolivares por venta de hamburguezas de pollo dobles:  ',totalv_hpd);
writeln('Total de bolivares por venta de hamburguezas de carne simples: ',totalv_hcs);
writeln('Total de bolivares por venta de hamburguezas de carne dobles:  ',totalv_hcd);
writeln('Total de bolivares por venta de hamburguezas mixtas: ',totalv_h_mix);
writeln('Total de bolivares por venta de perros calientes normales: ',totalv_pcn);
writeln('Total de bolivares por venta de perros calientes jumbo: ',totalv_pcj);
writeln('Total de bolivares por venta de refrescos: ',totalv_ref);
writeln('Total de bolivares por venta de té con limón: ',totalv_te);
writeln('Total de bolivares por venta de agua mineral: ',totalv_agua);
writeln;
writeln('Se obtuvieron ',totalv,' bolivares sin descuento');
writeln('Se obtuvieron ',totalv_desc,' bolivares con descuento');
if (contotal_hps>contotal_hpd) and (contotal_hps>contotal_hcs) and (contotal_hps>contotal_hcd) and (contotal_hps>contotal_mix) and (contotal_hps>contotal_pcn) and (contotal_hps>contotal_pcj) and (contotal_hps>contotal_ref) and (contotal_hps>contotal_te) and (contotal_hps>contotal_agu) then
begin
writeln('El producto mas vendido fue: ',hp_s,'con ',contotal_hps,' ventas!');
end;
if (contotal_hpd>cont_hps) and (contotal_hpd>contotal_hcs) and (contotal_hpd>contotal_hcd) and (contotal_hpd>contotal_mix) and (contotal_hpd>contotal_pcn) and (contotal_hpd>contotal_pcj) and (contotal_hpd>contotal_ref) and (contotal_hpd>contotal_te) and (contotal_hpd>contotal_agu) then
begin
writeln('El producto mas vendido fue: ',hp_d,' con ',contotal_hpd)
end;
end;


end;

end.
 :rain:

morales99

  • Nuevo Miembro
  • *
  • Mensajes: 1
    • Ver Perfil
Re:por favor.tengo varios errores
« Respuesta #1 en: Domingo 3 de Septiembre de 2017, 22:22 »
0
Alguien que pueda ayudarme? me marca errores (13,6) Fatal: syntax error, "." expected but ";" found
Program Suma_resta_multiplicacion_divicion;
uses crt;
var
x: Integer;
begin
  clrscr;
  write('Preciona  EZ para sumar, P2 para restar, C3 para multiplicar o V4 si decea dividir');
  if X=EZ then
  write('Dame dos numeros:')
  read (C4,F5)
  O3:=(C4+F5)
  read (O3)
  write ('El resultado es:',O3)
  end;
  else
  if X=P2  then
  write ('Dame dos numeros')
  read (Y3,Q9)
   W1:=(Y3-Q9)
   write ('El resultado es:',W1)
   end;
   else
   if X=C3 then
   write ('Dame dos numeros')
   read(M5,B2)
   L6:=(M5*B2)
   write ('El resultado es:',L6)
   end;
   else
   if X=V4 then
   write ('Damedos numeros')
   read(U4,K3)
   L12:=(U4/K3)
   write ('El resultado es:',L12)
   end.



Ashertova

  • Nuevo Miembro
  • *
  • Mensajes: 1
  • Nacionalidad: 00
    • Ver Perfil
Re:por favor.tengo varios errores
« Respuesta #2 en: Lunes 11 de Septiembre de 2017, 12:00 »
0
Was the problem resolved? Still with what you come across.