martes, 28 de febrero de 2012

Programa de Area del Circulo

program circulo;
uses crt;
var r:integer;
    a:real;
begin
    clrscr;
    write('teclea el radio del circulo: ');
    readln(r);
    a:=3.1416*(r*r);
writeln ('el area del circulo es: ',a:5:2);
readln;
end.

Programa Muestra de Nombre

program nombre;
uses crt;
     var Cesar, Lopez, Vargas: char;
begin
     clrscr;
     write('introduce una letra: ');
     readln(Cesar, Lopez, Vargas);
     writeln('el caracter introducido es :  Cesar, Lopez, Vargas' );
     readln;
end.

Programa de Recetas de Comida

program comida;
 uses crt;
        var opn:char;
 procedure pasi;
  begin
     textmode(lo(lastmode)+font8x8);

     textcolor(red);
     writeln('Ingredientes para preparar Pasta Italiana:');
     writeln;
     writeln('- 225 gramos de pasta al gusto');
     writeln('- Una cda. de aceite de oliva');
     writeln('- Una cda. de manteca');
     writeln('- 80 gramos de berro, picado');
     writeln('- 40 gramos de manzana');
     writeln('- sal y pimienta');
     end;
 procedure calma;
   begin
    textmode(lo(lastmode)+font8x8);

     textcolor(blue);
   writeln('Ingredientes para preparar Caldo de Mariscos:  ');
   writeln;
   writeln('- 5 cabezas de mojarra o bagre,grandes ');
   writeln('- 1/2 kg. de camaron crudo');
   writeln('- 4 filetes de mojarra de granja ');
   writeln('- 1/2 kg.l de surtido de mariscos');
   writeln('- tomates ,3 picados y 1 para licuar');
   writeln('- cebolla picada');
   writeln('- manojo de cilantro, picado');
   writeln('- chile verde,picado');
   writeln('- zanahorias , picadas');
   writeln('- varita de apio , picada');
   writeln('- chile morr•n ,picado');
   writeln('- aceite al gusto');
   end;
 procedure enru;
    begin
       textmode(lo(lastmode)+font8x8);

     textcolor(green);
    writeln('Ingredientes para preparar Ensalada Rusa:');
    writeln;
    writeln('- 4 papas chicas');
    writeln('- 2 zanahorias');
    writeln('- 1 huevo');
    writeln('- 300 g.  de jam•n cocido');
    writeln('- 100 gramos de arvejas (judas verdes)');
    writeln('- 100 g. de guisantes');
    writeln('- 1 lim•n');
    writeln('- aceite de oliva');
    writeln('- sal y pimienta');
    end;
 procedure torti;
   begin
    textmode(lo(lastmode)+font8x8);

     textcolor(red);
   writeln('Ingredientes para preparar Torta Inglesa:');
   writeln;
   writeln('- 5 huevos separados');
   writeln('- 150 g. de azucar');
   writeln('- 45 g. de almendras molidas');
   writeln('- 50 g. de mantequilla');
   writeln('- 325 g. de az—car de pasteleria ');
   writeln('- 300 g. de chocolate amargo derretido');
   writeln('- 1 cucharadita de extracto de almendra');
   writeln('- 2 cucharadas de mantequilla derretida');
   writeln('- 35 g. de almendras tostadas');
   end;
     begin
  repeat

      writeln;
          textmode(lo(lastmode)+font8x8);

     textcolor(yellow);
      writeln('--Programa de Recetas -- ');
      writeln;
        textmode(lo(lastmode)+font8x8);

     textcolor(yellow);
  writeln('¨Que quiere preparar? :  ');
      writeln;
        textmode(lo(lastmode)+font8x8);
     textcolor(red);
       writeln('1)Pasta Italiana');
        textmode(lo(lastmode)+font8x8);
     textcolor(blue);
       writeln('2)Caldo de Mariscos');
        textmode(lo(lastmode)+font8x8);
     textcolor(red);
       writeln('3)Ensalada Rusa');
       textmode(lo(lastmode)+font8x8);
     textcolor(blue);
       writeln('4)Torta Inglesa');
       textmode(lo(lastmode)+font8x8);
     textcolor(green);
  writeln('5)Salir');
     readln(opn);
     case opn of
     '1':pasi;
     '2':calma;
     '3':enru;
     '4':torti;
     end;
     until opn ='5';
  end.

tablas de multiplicar

program operacionestab;
uses crt;
var op:char;
 Procedure tabl;
          var a,b,n:integer;
       begin
 clrscr;
       textmode(lo(lastmode)+font8x8);
       writeln('');
       textcolor(red);
       write('Ingresa el n£mero de la tabla que quieras saber :');
       readln(a);
        textmode(lo(lastmode)+font8x8);
       writeln;
       textcolor(white-green);
       for n:=1 to 10 do
       begin
            b:=a*n;
            writeln(a,'x',n,'=',b );
       end;
       readln;
end;
begin
     repeat
      writeln;
       textmode(lo(lastmode)+font8x8);
       writeln('');
       textcolor(green);
      writeln('___ Programa de Tablas de Multiplicar ___ ');
      writeln;
      textmode(lo(lastmode)+font8x8);
       writeln('');
       textcolor(yellow);
     writeln('1)entrar');
      textmode(lo(lastmode)+font8x8);
      writeln;
      textcolor(white-green);
     writeln('2)salir');
     writeln;
     textcolor(red);
     readln(op);
     case op of
     '1':tabl;
     end;
     until op ='2';
end.