Pascal/Turbo Pascal - Ayuda!!! Error Tiempo de Ejecucion

 
Vista:
sin imagen de perfil

Ayuda!!! Error Tiempo de Ejecucion

Publicado por Maximiliano (1 intervención) el 25/04/2017 01:45:49
Hola, buenas.

El programa de a continuación debería leer una nota en notación anglosajona y entregar su equivalente en Español. El programa debería acabar cuando se le ingrese una "X". El problema es que el control de ciclo al parecer no funciona y no entiendo el porque.

*Casos de prueba:

CM
Dm
FM
X

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
program TraduceAcordes (input,output);
var
    chord,Mm:char;
    condicion:boolean;
 
procedure AcordesSp(a,b:char);
begin
	case a of
            'C':begin
                    if b = 'M' then
                        writeln('Do mayor')
                    else
                        writeln('Do menor');
                    end;
            'D':begin
                    if b = 'M' then
                        writeln('Re mayor')
                    else
                        writeln('Re menor');
                end;
            'E':begin
                    if b = 'M' then
                        writeln('Mi mayor')
                    else
                        writeln('Mi menor');
                    end;
            'F':begin
                    if b = 'M' then
                        writeln('Fa mayor')
                    else
                        writeln('Fa menor');
                    end;
            'G':begin
                    if b = 'M' then
                        writeln('Sol mayor')
                    else
                        writeln('Sol menor');
                    end;
            'A':begin
                    if b = 'M' then
                        writeln('La mayor')
                    else
                        writeln('La menor');
                    end;
            'B':begin
                    if b = 'M' then
                        writeln('Si mayor')
                    else
                        writeln('Si menor');
                    end;
 
    end;
 
end;
 
 
begin
	condicion:=false;
   repeat
   		read(chord,Mm);
   		readln;
   		if (chord = 'X') then
   			condicion:=true
   		else
   			AcordesSp(chord,Mm);
	until condicion;
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

Ayuda!!! Error Tiempo de Ejecucion

Publicado por ramon (2158 intervenciones) el 04/05/2017 18:10:25
Mira esto

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
program TraduceAcordes (input,output);
uses
   crt;
var
    chord,Mm:char;
    condicion:boolean;
 
procedure AcordesSp(a,b:char);
begin
	case a of
            'C':begin
                    if b = 'M' then
                        writeln('Do mayor')
                    else
                        writeln('Do menor');
                    end;
            'D':begin
                    if b = 'M' then
                        writeln('Re mayor')
                    else
                        writeln('Re menor');
                end;
            'E':begin
                    if b = 'M' then
                        writeln('Mi mayor')
                    else
                        writeln('Mi menor');
                    end;
            'F':begin
                    if b = 'M' then
                        writeln('Fa mayor')
                    else
                        writeln('Fa menor');
                    end;
            'G':begin
                    if b = 'M' then
                        writeln('Sol mayor')
                    else
                        writeln('Sol menor');
                    end;
            'A':begin
                    if b = 'M' then
                        writeln('La mayor')
                    else
                        writeln('La menor');
                    end;
            'B':begin
                    if b = 'M' then
                        writeln('Si mayor')
                    else
                        writeln('Si menor');
                    end;
 
    end;
 
end;
 
 
begin
	condicion:=false;
     repeat
                clrscr;
                write('Entre Letra 1 ');
   		chord := readkey;
                write('Entre Letra 2 ');
   		mm := readkey;
   		if (chord = 'X') then
   			condicion:=true
   		else
   			AcordesSp(chord,Mm);
                writeln;
                writeln('Pulse Una Tecla');
                readkey;
	until condicion;
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
sin imagen de perfil

Ayuda!!! Error Tiempo de Ejecucion

Publicado por Eduardo (1 intervención) el 17/05/2017 04:16:41
Ramon por favor pasame tu correo necesito de tu ayuda
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