Advertisement
EstebanT

tp 6 inciso C

Jun 2nd, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.08 KB | None | 0 0
  1. Program VI inciso a
  2. type
  3. sub1: 1..3;
  4. electrod: record
  5.         codigo: integer;
  6.         tipo: sub1;
  7.         marca: string [25];
  8.         cliente: string [30];
  9.         falla: string [255];
  10.         monto: real;
  11. var  cant: integer;
  12.  
  13.  
  14. procedure leer (var e: electrod)
  15. begin
  16.     with electrod do begin
  17.     writeln ("Ingrese tipo de producto")
  18.     writeln('1) Licuadora');
  19.     writeln('2) Tostadora');
  20.     writeln('3) Cafetera');
  21.     readln (tipo);
  22.     write ('Ingrese marca: ');
  23.     readln(marca);
  24.     write ('Ingrese cliente: ');
  25.     readln(cliente);
  26.     write ('Ingrese falla: ');
  27.     readln(falla);
  28.     write ('Ingrese monto: ');
  29.     readln(monto);
  30.     end;
  31. end;
  32. begin                                                                        
  33. cant:=0;                                                            
  34. leer (electrod);                                                    
  35. while ( electrod.tipo = 1 ) and ( electrod.monto <= 50 ) then begin
  36.     cant:= cant +1;
  37.     leer(electrod);
  38. end;
  39. write ('La cantidad de licuadoras cuyo monto es menor a 50 es de: ', cant;)
  40. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement