Pascal/Turbo Pascal - ejercicio matematica en pascal

 
Vista:

ejercicio matematica en pascal

Publicado por samuel (9 intervenciones) el 24/04/2013 05:42:51
buenas tardes a todos por fa necesito un ejemplo de un programaque resuelva un ejercicio de matematica por arreglo de registro con menu incluir,consultar,modificar,eliminar,reporte y salida
gracias espero su opinion y ayuda podria ser la resolvente para ecuacion de segundo grado o que haga las 4 operaciones basica suma,resta,multiplicacion y division pero con las caracteristicas planteada que sea por arreglo de registro y con menu
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

ejercicio matematica en pascal

Publicado por ramon (2158 intervenciones) el 24/04/2013 18:55:06
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{Mira si esto te ayuda}
 
program mates;
 uses
    crt;
  type
    operac = record
           dat1 : longint;
           dat2 : longint;
           resu : real;
         end;
   const
      num = 6;
  var
     func : array[1..num] of operac;
     cont : integer;
     tecl : char;
 
  procedure muesta_del_array;
  var
     tt : integer;
  begin
     writeln('Presentacion De Las Operaciones');
     writeln;
     for tt := 1 to cont - 1 do
     begin
     if func[tt].dat2 > 0 then
     writeln(func[tt].dat1,'----',func[tt].dat2,'----',
                                                   func[tt].resu:0:2)
  else
     writeln(func[tt].dat1,'--Raiz--',func[tt].resu:0:2)
     end;
      writeln;
      writeln('   Pulse Una Tecla');
      readkey;
  end;
 
  procedure suma;
  begin
      writeln('Calculo De La Suma De Dos Numeros');
      writeln;
      write('   Entre Num. 1 : ');
      readln(func[cont].dat1);
      write('   Eltre Num. 2 : ');
      readln(func[cont].dat2);
      func[cont].resu := func[cont].dat1 + func[cont].dat2;
      writeln('   El Resultado Es : ', func[cont].resu:0:0);
      cont := cont + 1;
      writeln;
      writeln('   Pulse Una Tecla');
      readkey;
  end;
 
  procedure resta;
  begin
      writeln('Calculo De La Resta De Dos Numeros');
      writeln;
      write('   Entre Num. 1 : ');
      readln(func[cont].dat1);
      write('   Eltre Num. 2 : ');
      readln(func[cont].dat2);
      func[cont].resu := func[cont].dat1 - func[cont].dat2;
      writeln('   El Resultado Es : ',func[cont].resu:0:0);
      cont := cont + 1;
      writeln;
      writeln('   Pulse Una Tecla');
      readkey;
  end;
 
  procedure multiplicacion;
  begin
      writeln('Calculo De La Multiplicacion De Dos Numeros');
      writeln;
      write('   Multiplicando Num. : ');
      readln(func[cont].dat1);
      write('   Multiplicador Num. : ');
      readln(func[cont].dat2);
      func[cont].resu := func[cont].dat1 * func[cont].dat2;
      writeln('   El Resultado Es : ',func[cont].resu:0:0);
      cont := cont + 1;
      writeln;
      writeln('   Pulse Una Tecla');
      readkey;
  end;
 
  procedure division;
  begin
      writeln('Calculo De La division De Dos Numeros');
      writeln;
      write('   Dividendo Num. : ');
      readln(func[cont].dat1);
      write('   Divisor Num.   : ');
      readln(func[cont].dat2);
      func[cont].resu := func[cont].dat1 / func[cont].dat2;
      writeln('   El Resultado Es : ',func[cont].resu:0:2);
      cont := cont + 1;
      writeln;
      writeln('   Pulse Una Tecla');
      readkey;
  end;
 
  procedure porciento;
  begin
      writeln('Calculo Del Tanto 100 De Un Valor');
      writeln;
      write('   Cantidad Num.     : ');
      readln(func[cont].dat1);
      write('   Tanto Por 100 Num.: ');
      readln(func[cont].dat2);
      func[cont].resu := (func[cont].dat1 * func[cont].dat2) / 100;
      writeln('   El Resultado Es : ',func[cont].resu:0:2);
      cont := cont + 1;
      writeln;
      writeln('   Pulse Una Tecla');
      readkey;
  end;
 
  procedure raizcuadrada;
  begin
      writeln('Calculo De Raiz Cuadrada De Un Numero');
      writeln;
      write('   Numero  Num.     : ');
      readln(func[cont].dat1);
      func[cont].dat2 := 0;
      func[cont].resu := Sqrt(func[cont].dat1);
      writeln('   El Resultado Es : ',func[cont].resu:0:2);
      cont := cont + 1;
      writeln;
      writeln('   Pulse Una Tecla');
      readkey;
  end;
 
  procedure menu;
  var
     fin : boolean;
   begin
      fin := false;
  repeat
    clrscr;
    writeln('<<<<< Menu Mates >>>>>');
    writeln;
    writeln('     1 = Suma');
    writeln('     2 = Resta');
    writeln('     3 = Multiplicacion');
    writeln('     4 = Division');
    writeln('     5 = Tanto por Ciento');
    writeln('     6 = Raiz Cuadrada');
    writeln('     7 = Muestra Array Registros');
    writeln('     8 = Salir');
    writeln;
    writeln('***** Elija Opcion *****');
    repeat
    tecl := readkey;
    until tecl in[#49..#56];
   case tecl of
 #49 : begin clrscr; suma; end;
 #50 : begin clrscr; resta; end;
 #51 : begin clrscr; multiplicacion; end;
 #52 : begin clrscr; division; end;
 #53 : begin clrscr; porciento; end;
 #54 : begin clrscr; raizcuadrada; end;
 #55 : begin clrscr; muesta_del_array; end;
 #56 : fin := true;
  end;
  until fin = true;
 end;
 
 begin
     cont := 1;
     menu;
 end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

ejercicio matematica en pascal

Publicado por samuel (9 intervenciones) el 25/04/2013 22:32:35
gracias de verdad si me sirve
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar