Pascal/Turbo Pascal - problema con el until

 
Vista:

problema con el until

Publicado por mery (8 intervenciones) el 10/10/2014 12:27:11
Hola! intentamos hacer una calculadora pero no nos copila porque dice que encuentra un until donde esperaba un punto y coma pero después de cambiarlos ponerlos y quitarlos de todas las opciones nos sigue saliendo
begin

repeat
writeln ('menu');
writeln ('1.suma');
writeln ('2.resta');
writeln ('3.multiplicacion');
writeln ('4.dividir');
writeln ('5.raiz cuadrada');
writeln ('6.inverso');
writeln ('7.salir');
read (operacion);
if operacion=1 then
begin
writeln ('operando1');
read (A);
writeln ('operando2');
read (B);
C:=A+B;
writeln (C)

end
else
begin
if operacion=2 then
begin
writeln ('operando1');
read (A);
writeln ('operando2');
read (B);
C:=A-B;
writeln (C)
end
else
begin
if operacion=3 then
begin
writeln ('numero');
read (A);
writeln ('numero');
read (B);
C:=B*A;
writeln ('resultado',C)
end
else
begin
if operacion=4 then
begin
read (A);
read (B);
if B>0 then
begin
res:= A/B;
writeln (res)
end
else
writeln ('error')
end
else
begin
if operacion=5 then
begin
read (A);
raiz:= sqrt(A);
writeln (raiz)
end
else
begin
operacion:=6;
begin
read (A);
inverso:= 1/A;
writeln (inverso)
end

end

end








until operacion=7

end.
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

problema con el until

Publicado por ramon (2158 intervenciones) el 11/10/2014 00:05:50
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
{Mira la modificación de tu programa}
 
var
  operacion : integer;
  c, a, b : integer;
  inverso, raiz, res : real;
 
begin
repeat
writeln ('menu');
writeln ('1.suma');
writeln ('2.resta');
writeln ('3.multiplicacion');
writeln ('4.dividir');
writeln ('5.raiz cuadrada');
writeln ('6.inverso');
writeln ('7.salir');
readln(operacion);
if operacion = 1 then
begin
write('operando1 = ');
readln(A);
write('operando2 = ');
readln(B);
C := (A + B);
writeln(C);
end;
if operacion = 2 then
begin
write('operando1 = ');
readln(A);
write('operando2 = ');
readln(B);
C := (A - B);
writeln(C)
end;
if operacion = 3 then
begin
write('numero = ');
readln(A);
write('numero = ');
readln(B);
C := (B * A);
writeln('resultado = ',C)
end;
if operacion = 4 then
begin
write('numero = ');
readln(A);
write('numero = ');
readln(B);
if (B > 0) and (A > 0) then
begin
res := (A / B);
writeln (res)
 end;
end;
if operacion = 5 then
begin
write('numero = ');
readln(A);
raiz := sqrt(A);
writeln(raiz)
end;
if operacion = 6 then
begin
write('numero = ');
readln(A);
inverso := (1 / A);
writeln(inverso)
end;
until operacion = 7
 
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