Pascal/Turbo Pascal - ayuda hacer este programa en pascal por favor

 
Vista:

ayuda hacer este programa en pascal por favor

Publicado por humberto (1 intervención) el 18/07/2012 04:17:12
Hacer un programa que registre la nota de 3 estudiante y que pida el nombre de cada estudiante y su matricula ante de registral la notas de cada parcial. Cada parcial tiene una nota de 0 A 30 punto máximo y la nota de cada parcial se sumara junto con su 10 punto de asistencia luego de ser sumada dará una nota final. Luego del resultado de la nota final si es de 90 a 100 dirá que es una A, si la nota es de 80 a 89 será una B, si la nota es 70 a 79 será una C y si la nota es menor de 70 será una R de reprobado. Y que diga el nombre del estudiante que saco la mayor nota.
Y hacer un menú que te permita entrar al programa y salir del programa.
Y que el resultado todos los estudiantes salgan imprimida en la misma pantalla.


Estudiante: Leonardo Báez
Matricula: 2118602
P1 P2 P3 10P NF Eq.
30 25 25 10 90 A
Estudiante: Willy Almonte
Matricula: 2118602
P1 P2 P3 10P NF Eq.
22 20 30 10 82 B
Estudiante: nicaury Pérez
Matricula: 2118602
P1 P2 P3 10P NF Eq.
20 12 30 8 70 C

Matricula: 2118602
P1 P2 P3 10P NF Eq.
15 16 12 7 50 F
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 hacer este programa en pascal por favor

Publicado por ramon (2158 intervenciones) el 20/07/2012 20:09:28
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
172
173
174
175
176
177
{Espero esto ayude }
 
 program vernotas;
  uses
     crt;
  const
      asistencia : integer = 10;
  var
    notas : array[1..3] of record
            nombre : string[100];
            nmatri : word;
            parcia : array[1..10] of integer;
          end;
    tecla : char;
    estu, i, k : integer;
    asig : array[1..10] of integer;
 
 
  procedure ponerror(np : string);
  begin
     gotoxy(5,15);write(np);
  end;
 
  procedure pidedatos;
  var
     final, datos : boolean;
     entra : string[100];
     t, a, temp, zz : integer;
     err : string;
  begin
      i := 1;
      err := ' ';
    repeat
      clrscr;
      ponerror(err);
      err := ' ';
      datos := true;
      fillchar(entra,101,' ');
      entra[0] := chr(100);
      gotoxy(5,2);write('***** Entradas Dato Estudiante *****');
      gotoxy(5,4);write('Nombre Y 1§ Apellido : ');
      gotoxy(5,5);write('N§ Matricula         : ');
      gotoxy(28,4);readln(entra);
      gotoxy(28,5);readln(notas[i].nmatri);
      gotoxy(5,15);clreol;
      for zz := 1 to length(entra) do
      begin
      notas[i].nombre[zz] := upcase(entra[zz]);
      notas[i].nombre[0] := chr(zz);
      end;
      if i > 1 then
      begin
      for zz := i - 1 downto 1 do
      begin
         if (notas[i].nombre = notas[zz].nombre) or
            (notas[i].nmatri = notas[zz].nmatri) then
         begin
            datos := false;
            err := 'Datos Ya En Ficha Entre Otra';
            break;
         end
       else
          begin
             datos := true;
          end;
      end;
    end
  else
     begin
      datos := true;
     end;
   if datos = true then
   begin
   k := 1;
   gotoxy(5,7);write('Entrando [0] Finalizan Notas');
   final := false;
   repeat
   gotoxy(5,7 + k);write('Notas Parcial N§ ',k,' : ');
   gotoxy(25,7 + k);write('    ');
   gotoxy(26, 7 + k);readln(notas[i].parcia[k]);
   if notas[i].parcia[k] = 0 then
   final := true;
   if (notas[i].parcia[k] <= 10) and (final = false) then
   begin
   notas[i].parcia[k] := notas[i].parcia[k] + asistencia;
   k := k + 1;
   end;
   until (k > 10) or (final = true);
   asig[i] := k - 1;
   final := false;
   gotoxy(5,8 + k);write('[Enter] Finaliza Otra Sige');
   tecla := readkey;
   if tecla <> #13 then
   i := i + 1;
   end;
   until (tecla = #13) or (i > 3);
   estu := i;
   for t := 1 to 10 do
     for a := 10 downto t do
     if asig[t] < asig[a] then
     begin
        temp := asig[t];
        asig[t] := asig[a];
        asig[a] := temp;
     end;
  end;
 
   procedure presentanotas(nox : integer);
   var
      dd, k, l, p, nota : integer;
      total : array[1..3] of integer;
      par : string[100];
   begin
       clrscr;
       p := 1;
       gotoxy(4,2);write('***** Presentacion De Notas Finales *****');
       for nota := 1 to nox do
       begin
          gotoxy(4,3 + p);write('Nombre     = ',notas[nota].nombre);
          gotoxy(4,4 + p);write('Matricula  = ',notas[nota].nmatri);
 gotoxy(4,5 + p);write('P1  P2  P3  P4  P5  P6  P7  P8  P9  P10  NF  Eq.');
          total[nota] := 0;
          for k := 1 to asig[1] do
          begin
          gotoxy(0 + (k * 4),6 + p);write(notas[nota].parcia[k]);
          total[nota] := total[nota] + notas[nota].parcia[k];
          end;
          gotoxy(45,6 + p);write(total[nota]);
          case total[nota] of
       1..69 : begin gotoxy(49,6 + p);write('R'); end;
      70..79 : begin gotoxy(49,6 + p);write('C'); end;
      80..89 : begin gotoxy(49,6 + p);write('B'); end;
     90..100 : begin gotoxy(49,6 + p);write('A'); end;
          end;
          p := p + 5;
       end;
     for k := 1 to asig[1] do
       for l := asig[1] downto k do
       if total[k] < total[l] then
       begin
           par := notas[k].nombre;
           dd := total[k];
           notas[k].nombre := notas[l].nombre;
           total[k] := total[l];
           notas[l].nombre := par;
           total[l] := dd;
       end;
       gotoxy(4,5 + p);write('La Mayor Puntuacion Es De : ',notas[1].nombre);
       readln;
   end;
 
   procedure menu;
   var
     tec : char;
     sal : boolean;
   begin
       sal := false;
       repeat
          clrscr;
          gotoxy(4,2);write('****** Menu Jeneral ******');
          gotoxy(4,4);write('  1 = Entradas Datos');
          gotoxy(4,5);write('  2 = Ver Resultados');
          gotoxy(4,6);write('  3 = Finalizar');
          gotoxy(4,8);write('<<< Elija Opcion >>>');
          tec := readkey;
       case tec of
     #49 : begin clrscr; pidedatos; end;
     #50 : begin clrscr; presentanotas(estu); end;
     #51 : sal := true;
      end;
    until sal = true;
   end;
 
 
   begin
       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
sin imagen de perfil
Val: 36
Ha aumentado su posición en 4 puestos en Pascal/Turbo Pascal (en relación al último mes)
Gráfica de Pascal/Turbo Pascal

ayuda hacer este programa en pascal por favor

Publicado por Armando Fuenmayor (43 intervenciones) el 20/07/2012 22:29:53
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
172
173
174
175
176
177
program colegio(input,output);
uses crt;
 const
   n = 3;
type
matriestudiante = record
   Ape_y_Nombre  : String[18];
   matricula     : String[18];
   par1          : Integer ;
   par2          : Integer ;
   par3          : Integer ;
   asistencia    : Integer;
   notafinal     : Integer;
   letra         : Char ;
 end;
  Aobre = array[1..n] of matriestudiante ;
 var
   i, n1, n2, n3, pos, mayor  : Integer;
   nonmayor, matriculamayor : string;
   xx : Aobre;
   ch : char;
    (******************)
    (*  funcion letra *)
    (******************)
    function lll(aa: integer): char;
    begin
      if (aa >= 90) and (aa <= 100) then
      begin
        lll :=  'A';
      end;
      if (aa >= 80) and (aa <= 89) then
      begin
        lll :=  'B';
      end;
      if (aa >= 70) and (aa <= 79) then
      begin
        lll :=  'C';
      end;
      if (aa >= 0) and (aa <= 69) then
      begin
        lll :=  'R';
      end;
    end;
  (************************************************)
  (* FUNCION QUE CONVIERTE UNA CADENA A MAYUSCULA *)
  (************************************************)
  function UpCaseStr(S: string): string;
  var
  jj: Integer;
  begin for jj := 1 to Length(S) do
  if (S[jj] >= 'a') and (S[jj] <= 'z') then
  Dec(S[jj], 32); UpCaseStr := S;
  end;
     (*********)
    procedure ingresar;
    begin
      clrscr;
    for i := 1 to n do
    begin
      clrscr;
      writeln('Apellido y Nombre No : ', i , ' = ' ) ;
      readln(xx[i].Ape_y_Nombre);
      writeln('Matricula No : ', i , ' = ' ) ;
      readln(xx[i].matricula);
    repeat
      writeln('Parcial 1  de : ', xx[i].Ape_y_Nombre , ':' ) ;
      readln(xx[i].par1);
    until (xx[i].par1 >= 0) and (xx[i].par1 <= 30);
    repeat
      writeln('Parcial 2  de : ', xx[i].Ape_y_Nombre , ':' ) ;
      readln(xx[i].par2);
 
 
    until (xx[i].par2 >= 0) and (xx[i].par2 <= 30);
    repeat
      writeln('Parcial 3  de : ', xx[i].Ape_y_Nombre , ':' ) ;
      readln(xx[i].par3);
    until (xx[i].par3 >= 0) and (xx[i].par3 <= 30);
    writeln('ASISTENCIA de : ', xx[i].Ape_y_Nombre , ' 10 ' ) ;
    xx[i].asistencia := 10;
    writeln('<--------- ENTER PARA CONTINUAR ' ) ;
    readln;
    xx[i].notafinal :=  xx[i].par1 + xx[i].par2 + xx[i].par3 + xx[i].asistencia;
    xx[i].letra  :=  lll(xx[i].notafinal)
    end;
    end;
 
    procedure mostrar;
    begin
      gotoxy(3,4);
      write(' NOMBRES        MATRICULA  P1  P2  P3 ASIST  NT  EQ');
    for i := 1 to n do
    begin
      gotoxy(1,5+i);
      write(UpCaseStr(xx[i].Ape_y_Nombre));
      gotoxy(20,5+i);
      write(xx[i].matricula);
      gotoxy(30,5+i);
      write(xx[i].par1);
      gotoxy(34,5+i);
      write(xx[i].par2);
      gotoxy(38,5+i);
      write(xx[i].par3);
      gotoxy(42,5+i);
      write(xx[i].asistencia);
      gotoxy(46,5+i);
      write(xx[i].notafinal);
      gotoxy(52,5+i);
      write(xx[i].letra);
      writeln;
    end;
         readln;
    end;
     (**********************)
     (* PROGRAMA PRINCIPAL *)
     (**********************)
     begin
 
 
   clrscr;
   repeat
       writeln('Ingresar datos (I) ');
       writeln('Mostrar Todo   (T) ');
       writeln('Mostrar Mayor  (M) ');
       writeln('Salir          (S) ');
 
     Ch := UPCASE(readkey);
        clrscr;
     case Ch of
       'I':    ingresar;
       'T':  mostrar;
 
       'M':
       begin
     clrscr;
     gotoxy(1,1);
     Write('Muestra el alumno con la nota mayor: ');
      n1  := xx[1].par1  ;
      n2  := xx[1].par2  ;
      n3  := xx[1].par3  ;
      mayor := xx[1].notafinal ;
      matriculamayor := xx[1].matricula  ;
      nonmayor := xx[1].Ape_y_Nombre ;
 
    for i := 1 to n do
    begin
      if (xx[i].notafinal > mayor) then
      begin
        mayor := xx[i].notafinal ;
        nonmayor := xx[i].Ape_y_Nombre ;
        matriculamayor := xx[i].matricula  ;
        n1  := xx[i].par1  ;
        n2  := xx[i].par2  ;
        n3  := xx[i].par3  ;
        pos := i;
     end;
     end;
      gotoxy(1,2);
      write('Nombre con mayor nota es: ', UpCaseStr(nonmayor));
      gotoxy(1,4);
      write('Matricula: ', matriculamayor );
      gotoxy(1,5);
      write('          P1  P2  P2   asist.   Total   ');
 
      gotoxy(1,6);
      write('NOTAS ',  n1:5 , n2:5 , n3:5 , '  10 ',  n1 +  n2 + n3 + 10);
      readln;
 
         end;
 
       'S': exit ;
     end;
 
   until Ch = 'S';
 
      readln;
     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