Documentos de Académico
Documentos de Profesional
Documentos de Cultura
ASIGNATURA: COMPUTACIÓN I
CÓDIGO: 323
NÚMERO DE ORIGINALES:
LAPSO: 2.017/2
Especificaciones:
Una institución educativa quiere implementar un proyecto para
estimular el rendimiento estudiantil. El proyecto consiste en
asignar becas estudiantiles, las cuales serán asignadas
dependiendo del promedio obtenido en cada uno de los lapsos (3
Lapsos), tal como se muestra en la Cuadro 1.<
Nro. Alumnos
Grado
Lapso
Notas
Materia 1
Materia 2
Materia 3
Materia 5
Materia 4
Promedio de notas
Total de
becados Total a pagar
FORMATO R1
_ Total, de Alumnos por c/u de los Grados y Lapsos que tengan promedio
entre 16 ≤ Promedio ≤ 18. Además, el monto total a pagar por Beca. Ver
Formato R2.
Total de
becados Total a pagar
FORMATO R2
Desarrollo del Informe
· El estudiante deberá entregar, para tal fin un Informe contentivo de:
_ La solución analítica del problema planteado.
_ La solución del problema planteado utilizando la Metodología MAPS.
_ El diseño del algoritmo del problema planteado en Pseudocódigo, haciendo
uso de las técnicas de programación estructurada y/o subprogramas.
_ El algoritmo haciendo uso del concepto de Robustez.
_ El algoritmo codificado de manera estructurada en lenguaje Pascal.
_ Un CD contentivo del Programa en Pascal.
· Este trabajo será revisado y evaluado por el Asesor de su Centro Local, a
fin de verificar el dominio de los temas involucrados, y forma parte importante
de la evaluación de la asignatura. Se le sugiere seguir el orden de las
actividades a realizar correspondientes a los objetivos 5, 6,7 y 8, a fin de
llevar una mejor bitácora de solución:
Objetivo 5
- Resuelva el problema planteado algorítmicamente usando la metodología
MAPS, a fin de facilitar la conceptualización, diseño, planificación, ejecución
del problema planteado.
Objetivo 6
- Después de haber aplicado cada una de las etapas de la metodología
MAPS en el objetivo 5, diseñe un algoritmo usando técnicas de programación
estructurada, que cumplan con las especificaciones dadas; tenga especial
cuidado de hacer una buena declaración de datos y sus tipos.
Objetivo 7
- Pruebe el algoritmo diseñado en el Objetivo 6 usando el concepto de
Robustez; se requiere que Ud. exponga en el informe del trabajo, cuál era el
algoritmo original, y cuál quedó después de aplicarle la definición de la
propiedad algorítmica mencionada.
Objetivo 8
- Codifique el algoritmo obtenido a lenguaje PASCAL, a fin de obtener un
programa estructurado que cumpla con los requerimientos especificados,
aplicando tipo de datos y/o procedimientos y funciones y/o métodos de
archivos.
Criterio de Corrección:
Para considerar logrado los objetivos el estudiante debe:
- Haber utilizado correctamente la Metodología MAPS para resolver el
problema planteado.
- Presentar el diseño del Algoritmo donde se muestre el uso correcto de las
técnicas de programación estructurada.
- El Algoritmo debe cumplir con todos los requerimientos solicitados.
- Haber usado el concepto de Robustez para probar el Algoritmo.
- Haber codificado correctamente el algoritmo al lenguaje Pascal.
Desarrollo del trabajo
OBJETIVO 5 MAPS
Grado
Lapso 1
materias Mat 1 Mat 2 Mat 3 Mat 4 Mat 5 promedio
notas
Monto de la beca
Lapso 2
materias Total Total Total Total promedio
Monto de la beca
Lapso 3
materias Total Total Total Total promedio
Monto de la beca
Calcular Guardar
Grado
Lapso
Mat 1 Mat 2 Mat 3 Mat 4 Mat 5 Mat 6 promedio
notas
Monto de la beca
Promedio
Lapso
Mat 1 Total Materia 3 Total Mat 6
notas Materia 4
Lapso
materias Total Total Total Total promedio
c Calcular Guardar
Total
becados Total a pagar
_ Total, de Alumnos por c/u de los Grados y Lapsos que tengan promedio
entre 16 ≤ Promedio ≤ 18. Además, el monto total a pagar por Beca. Ver
Formato R2.
Total
becados Total a pagar
P1G1L
P1G1L2
P1G1L3
P1G2L1
P1G2L2
P1G2L3
P1G3L1
P1G3L2
P1G3L3
P1G4L1
P1G4L2
P1G4L3
P1G5L1
P1G5L2
P1G5L3
P1G6L1
P1G6L2
P1G6L3
P2G1L1
P2G1L2
P2G1L3
P2G2L1
P2G2L2
P2G2L3
P2G3L1
P2G3L2
P2G3L3
P2G4L1
P2G4L2
P2G4L3
P2G5L1
P2G5L2
P2G5L3
P2G6L1
P2G6L2
P2G6L3
Datos de entrada
Nombre y apellido
Número de registro
Lapso
Grado
Calificaciones o
Número de alumnos registrados, numero de becados y monto total a pagar por cada
rango/grado/lapso
5.3 LA PARTICIÒN
5. Ordenar registros.
• Leer opción.
procedure limpiar;
begin
if (f11.Caption >= '1' ) and (f12.Caption >= '1' ) and (f13.Caption >= '1' ) and
(q11.Caption >= '1' ) and (q12.Caption >= '1' ) and (q13.Caption >= '1' )
………… …………………………….. Then { aquí el programa se asegura de que
todas las cajas de texto estén llenas }
begin
F1 := f11.Value;
Q1 := q11.Value;
B1 := b11.Value;
S1 := s11.Value;
H1 := h11.Value;
….
….
…..;
{ calcular el promedio }
{ Mostrar el promedio }
pro11.Caption := FloatToStr(PRO1);
pro12.Caption := FloatToStr(PRO2);
pro13.Caption := FloatToStr(PRO3);
{ Asignacion de beca }
if ((pro11.Text >= '18.00' ) or (pro11.Text <= '20.00')) and (cb_grado.Text = '1ro') then
begin
monto11.Caption := FloatToStr(55000);
r1.Caption := FloatToStr(1);
end
else
if ((pro11.Text >= '16.00 ') or (pro11.Text <= '17.99') ) and (cb_grado.Text = '1ro') then
begin
monto11.Caption := FloatToStr(35000);
r1.Caption := FloatToStr(2);
end
else
if ((pro11.Text >= '1') or (pro11.Text <= '15.99')) and (cb_grado.Text = '1ro') then
begin
monto11.Caption := FloatToStr(0.00);
r1.Caption := FloatToStr(65);
begin
if (e_nombre_y_apellido.Text<>'' ) and (e_codigo.Text<>'' ) and
(cb_grado.Text<>'' )
{ para que al presionar la Tecla registrar el algoritmo se asegura que todos los campos
están llenos y que se ha presionado el botón calcular. No se incluyen las cajas de texto
referente a los montos de las becas porque estos se autocompletan al presionar calcular}
begin
bHizoRegistro := True;
Close;
end
else
begin
end;
end;
procedure TFRegistro.limpiar;
begin
cb_grado.Text:=' ';
f11.Text:=' '; Donde ' ' indica al programa que limpie las cajas de texto.
Para que ocurra esto se debe llamar al procedimiento limpiar en el formulario
del menú principal, dentro de la opción INGRESAR, una vez que el programa
comprueba que se hizo el registro cierra el formulario y limpia las cajas de
texto.
Dentro del menú principal se tienen las opciones para ingresar el registro de
los estudiantes dependiendo de si cursan los grados 1ro, 2do y 3ro o si
cursan 4to, 5to y 6to. Para ello se tiene el siguiente procedimiento:
var
cant : Integer;
begin
FRegistro_2.bHizoRegistro := False;
FRegistro.limpiar;
FRegistro_2.ShowModal;
if FRegistro.bHizoRegistro then
begin
cant := archivoEstudiantes.ReadInteger('Datos','Cantidad',0);
Inc(cant);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Nombre',FRegistro_2.obtenerNombre);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Codigo',FRegistro_2.obtenerCodigo);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Grado',FRegistro_2.obtenerGrado);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Fisica_1',FRegistro_2.obtenerFisica_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Quimica_1',FRegistro_2.obtenerQuimica_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Biologia_1',FRegistro_2.obtenerBiologia_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Salud_1',FRegistro_2.obtenerSalud_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Historia_1',FRegistro_2.obtenerHistoria_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Geografia_1',FRegistro_2.obtenerGeografia_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Promedio_1',FRegistro_2.obtenerPromedio_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Monto_beca_1',FRegistro_2.obtenerMonto_beca_1);
archivoEstudiantes.WriteInteger('Datos','Cantidad',cant);
lv_lista.Items.Clear;
ListView1.Items.Clear;
leerBaseDatosEstudiantes;
end;
end;
procedure TFPrincipal.leerBaseDatosEstudiantes;
var
cant, i, contador, total_becados, total_a_pagar : Integer;
nombre, codigo, grado, f1, q1, b1, s1, h1, g1, pro1, monto1, f2, q2, b2, s2,
h2, g2,
pro2, monto2, f3, q3, b3, s3, h3, g3, pro3, monto3 : String;
begin
cant := archivoEstudiantes.ReadInteger('Datos','Cantidad',0);
for i := 1 to cant do
begin
f1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
q1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
(i), 'Quimica_1', '');
b1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
s1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
h1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
g1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
with lv_lista.Items.Add do
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(f1);
SubItems.Add(q1);
SubItems.Add(b1);
SubItems.Add(s1);
SubItems.Add(h1);
SubItems.Add(g1);
SubItems.Add(pro1);
SubItems.Add(monto1);
SubItems.Add(f2);
SubItems.Add(q2);
SubItems.Add(b2);
SubItems.Add(s2);
SubItems.Add(h2);
SubItems.Add(g2);
SubItems.Add(pro2);
SubItems.Add(monto2);
SubItems.Add(f3);
SubItems.Add(q3);
SubItems.Add(b3);
SubItems.Add(s3);
SubItems.Add(h3);
SubItems.Add(g3);
SubItems.Add(pro3);
SubItems.Add(monto3);
para que muestre los datos en una tabla P1G1L1 seria de la siguiente forma,
primero se inicializan las variables contador, total_becados y total_a_pagar a
cero:
contador := 0;
total_becados := 0;
total_a_pagar := 0; Luego:
with ListView1.Items.Add do
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
Edit2.Text := IntToStr(total_a_pagar);
Edit3.Text := IntToStr(contador);
end;
De esta forma al leer el rango que es igual a 1 envía los datos del estudiante
a la tabla P1G1L1 y agrega los valores del ID, código, nombre y apellido,
grado, promedio, monto de la beca y en los cuadros de texto de la tabla
muestra el total de becados y el total a pagar.
OBJETIVO 6 PROGRAMACIÒN ESTRUCTURADA PSEUDOCÒDIGO
El algoritmo en pseudocódigo
{$mode objfpc}{$H+}
interface
uses
type
{ TFPrincipal }
TFPrincipal = class(TForm)
Edit1: TEdit;
Edit10: TEdit;
Edit11: TEdit;
Edit12: TEdit;
Edit13: TEdit;
Edit14: TEdit;
Edit15: TEdit;
Edit16: TEdit;
Edit17: TEdit;
Edit18: TEdit;
Edit19: TEdit;
Edit2: TEdit;
Edit20: TEdit;
Edit21: TEdit;
Edit22: TEdit;
Edit23: TEdit;
Edit24: TEdit;
Edit25: TEdit;
Edit26: TEdit;
Edit27: TEdit;
Edit28: TEdit;
Edit29: TEdit;
Edit3: TEdit;
Edit30: TEdit;
Edit31: TEdit;
Edit32: TEdit;
Edit33: TEdit;
Edit34: TEdit;
Edit35: TEdit;
Edit36: TEdit;
Edit37: TEdit;
Edit38: TEdit;
Edit39: TEdit;
Edit4: TEdit;
Edit40: TEdit;
Edit41: TEdit;
Edit42: TEdit;
Edit43: TEdit;
Edit44: TEdit;
Edit45: TEdit;
Edit46: TEdit;
Edit47: TEdit;
Edit48: TEdit;
Edit49: TEdit;
Edit5: TEdit;
Edit50: TEdit;
Edit51: TEdit;
Edit52: TEdit;
Edit53: TEdit;
Edit54: TEdit;
Edit55: TEdit;
Edit56: TEdit;
Edit57: TEdit;
Edit58: TEdit;
Edit59: TEdit;
Edit6: TEdit;
Edit60: TEdit;
Edit61: TEdit;
Edit62: TEdit;
Edit63: TEdit;
Edit64: TEdit;
Edit65: TEdit;
Edit66: TEdit;
Edit67: TEdit;
Edit68: TEdit;
Edit69: TEdit;
Edit7: TEdit;
Edit70: TEdit;
Edit71: TEdit;
Edit72: TEdit;
Edit8: TEdit;
Edit9: TEdit;
ListView1: TListView;
ListView10: TListView;
ListView11: TListView;
ListView12: TListView;
ListView13: TListView;
ListView14: TListView;
ListView15: TListView;
ListView16: TListView;
ListView17: TListView;
ListView18: TListView;
ListView19: TListView;
ListView2: TListView;
ListView20: TListView;
ListView21: TListView;
ListView22: TListView;
ListView23: TListView;
ListView24: TListView;
ListView25: TListView;
ListView26: TListView;
ListView27: TListView;
ListView28: TListView;
ListView29: TListView;
ListView3: TListView;
ListView30: TListView;
ListView31: TListView;
ListView32: TListView;
ListView33: TListView;
ListView34: TListView;
ListView35: TListView;
ListView36: TListView;
ListView4: TListView;
ListView5: TListView;
ListView6: TListView;
ListView7: TListView;
ListView8: TListView;
ListView9: TListView;
lv_lista: TListView;
MainMenu1: TMainMenu;
MenuItem1: TMenuItem;
REGISTRO1: TMenuItem;
REGISTRO2: TMenuItem;
PageControl1: TPageControl;
TabSheet0: TTabSheet;
TabSheet1: TTabSheet;
TabSheet10: TTabSheet;
TabSheet11: TTabSheet;
TabSheet12: TTabSheet;
TabSheet13: TTabSheet;
TabSheet14: TTabSheet;
TabSheet15: TTabSheet;
TabSheet16: TTabSheet;
TabSheet17: TTabSheet;
TabSheet18: TTabSheet;
TabSheet19: TTabSheet;
TabSheet2: TTabSheet;
TabSheet20: TTabSheet;
TabSheet21: TTabSheet;
TabSheet22: TTabSheet;
TabSheet23: TTabSheet;
TabSheet24: TTabSheet;
TabSheet25: TTabSheet;
TabSheet26: TTabSheet;
TabSheet27: TTabSheet;
TabSheet28: TTabSheet;
TabSheet29: TTabSheet;
TabSheet3: TTabSheet;
TabSheet30: TTabSheet;
TabSheet31: TTabSheet;
TabSheet32: TTabSheet;
TabSheet33: TTabSheet;
TabSheet34: TTabSheet;
TabSheet35: TTabSheet;
TabSheet36: TTabSheet;
TabSheet4: TTabSheet;
TabSheet5: TTabSheet;
TabSheet6: TTabSheet;
TabSheet7: TTabSheet;
TabSheet8: TTabSheet;
TabSheet9: TTabSheet;
private
public
procedure leerbasedatosestudiantes;
end;
var
FPrincipal: TFPrincipal;
archivoEstudiantes : TIniFile;
implementation
{$R *.lfm}
{ TFPrincipal }
begin
end;
var
cant : Integer;
begin
FRegistro.bregistro1 := False;
FRegistro.limpiar;
FRegistro.ShowModal;
if FRegistro.bregistro1 then
begin
cant := archivoEstudiantes.ReadInteger('Datos','Cantidad',0);
Inc(cant);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Nombre',FRegistro.obtenerNombre);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Codigo_1',FRegistro.obtenerCodigo_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Grado',FRegistro.obtenerGrado);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Fisica_1',FRegistro.obtenerFisica_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Quimica_1',FRegistro.obtenerQuimica_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Biologia_1',FRegistro.obtenerBiologia_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Salud_1',FRegistro.obtenerSalud_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Historia_1',FRegistro.obtenerHistoria_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Promedio_1',FRegistro.obtenerPromedio_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Monto_beca_1',FRegistro.obtenerMonto_beca_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Rango_1',FRegistro.obtenerRango_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Fisica_2',FRegistro.obtenerFisica_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Quimica_2',FRegistro.obtenerQuimica_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Biologia_2',FRegistro.obtenerBiologia_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Salud_2',FRegistro.obtenerSalud_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Historia_2',FRegistro.obtenerHistoria_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Promedio_2',FRegistro.obtenerPromedio_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Monto_beca_2',FRegistro.obtenerMonto_beca_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Rango_2',FRegistro.obtenerRango_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Fisica_3',FRegistro.obtenerFisica_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Quimica_3',FRegistro.obtenerQuimica_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Biologia_3',FRegistro.obtenerBiologia_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Salud_3',FRegistro.obtenerSalud_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Historia_3',FRegistro.obtenerHistoria_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Promedio_3',FRegistro.obtenerPromedio_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Monto_beca_3',FRegistro.obtenerMonto_beca_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Rango_3',FRegistro.obtenerRango_3);
archivoEstudiantes.WriteInteger('Datos','Cantidad',cant);
lv_lista.Items.Clear;
leerBaseDatosEstudiantes;
end;
end;
begin
archivoEstudiantes := TIniFile.Create('estudiantes.txt' );
leerbasedatosestudiantes;
end;
procedure TFPrincipal.REGISTRO2Click(Sender: TObject);
var
cant : integer;
begin
FRegistro_2.bregistro2:=False;
FRegistro_2.limpiar;
FRegistro_2.ShowModal;
if FRegistro_2.bregistro2 then
begin
cant := archivoEstudiantes.ReadInteger('Datos','Cantidad',0);
Inc(cant);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Nombre',FRegistro_2.obtenerNombre);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Codigo_1',FRegistro_2.obtenerCodigo_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Grado',FRegistro_2.obtenerGrado);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Fisica_1',FRegistro_2.obtenerFisica_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Quimica_1',FRegistro_2.obtenerQuimica_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Biologia_1',FRegistro_2.obtenerBiologia_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Salud_1',FRegistro_2.obtenerSalud_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Historia_1',FRegistro_2.obtenerHistoria_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Geografia_1',FRegistro_2.obtenerGeografia_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Promedio_1',FRegistro_2.obtenerPromedio_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Monto_beca_1',FRegistro_2.obtenerMonto_beca_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Rango_1',FRegistro_2.obtenerRango_1);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Fisica_2',FRegistro_2.obtenerFisica_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Quimica_2',FRegistro_2.obtenerQuimica_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Biologia_2',FRegistro_2.obtenerBiologia_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Salud_2',FRegistro_2.obtenerSalud_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Historia_2',FRegistro_2.obtenerHistoria_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Geografia_2',FRegistro_2.obtenerGeografia_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Promedio_2',FRegistro_2.obtenerPromedio_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Monto_beca_2',FRegistro_2.obtenerMonto_beca_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Rango_2',FRegistro_2.obtenerRango_2);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Fisica_3',FRegistro_2.obtenerFisica_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Quimica_3',FRegistro_2.obtenerQuimica_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Biologia_3',FRegistro_2.obtenerBiologia_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Salud_3',FRegistro_2.obtenerSalud_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Historia_3',FRegistro_2.obtenerHistoria_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Geografia_3',FRegistro_2.obtenerGeografia_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Promedio_3',FRegistro_2.obtenerPromedio_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Monto_beca_3',FRegistro_2.obtenerMonto_beca_3);
archivoEstudiantes.WriteString('Estudiante'+IntToStr(cant),
'Rango_3',FRegistro_2.obtenerRango_3);
archivoEstudiantes.WriteInteger('Datos','Cantidad',cant);
lv_lista.Items.Clear;
leerBaseDatosEstudiantes;
end;
end;
procedure TFPrincipal.leerbasedatosestudiantes;
var
cant, i, cn1, cn2, cn3, cn4, cn5, cn6, cn7, cn8, cn9, cn10, cn11, cn12, cn13,
cn14, cn15, cn16, cn17, cn18, cn19, cn20, cn21, cn22, cn23, cn24, cn25, cn26,
cn27, cn28, cn29, cn30, cn31, cn32, cn33, cn34, cn35, cn36, tb1, tb2, tb3, tb4, tb5,
tb6, tb7, tb8, tb9, tb10, tb11, tb12, tb13, tb14, tb15, tb16, tb17, tb18, tb19, tb20,
tb21, tb22, tb23, tb24, tb25, tb26, tb27, tb28, tb29, tb30, tb31, tb32, tb33, tb34,
tb35, tb36, tp1, tp2, tp3, tp4, tp5, tp6, tp7, tp8, tp9, tp10, tp11, tp12, tp13, tp14,
tp15, tp16, tp17, tp18, tp19, tp20, tp21, tp22, tp23, tp24, tp25, tp26, tp27, tp28,
nombre, codigo, grado, f1, q1, b1, s1, h1, g1, pro1, monto1, f2, q2, b2, s2, h2, g2,
pro2, monto2, f3, q3, b3, s3, h3, g3, pro3, monto3, r1, r2, r3: String;
begin
cant := archivoEstudiantes.ReadInteger('Datos','Cantidad',0);
for i := 1 to cant do
begin
f1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
q1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
b1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
s1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
h1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
g1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
r1 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
f2 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
q2 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
b2 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
h2 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
g2 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
r2 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
f3 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
q3 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
b3 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
s3 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
h3 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
g3 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
r3 := archivoEstudiantes.ReadString('Estudiante' +IntToStr
begin
cn1 := cn1 + 1;
tb1 := (cn1);
tp1 := 35000*cn1;
end;
while r2 = '3' do
begin
cn2 := cn2 + 1;
tb2 := (cn2);
tp2 := 35000*cn2;
end;
while r3 = '5' do
begin
cn3 := cn3 + 1;
tb3 := cn3;
tp3 := 35000*cn3;
end;
while r1 = '7' do
begin
cn4 := cn4 + 1;
tb4 := cn4;
tp4 := 35000*cn4;
end;
while r2 = '9' do
begin
cn5 := cn5 + 1;
tb5 := cn5;
tp5 := 35000*cn5;
end;
while r3 = '11' do
begin
cn6 := cn6 + 1;
tb6 := cn6;
tp6 := 35000*cn6;
end;
while r1 = '13' do
begin
cn7 := cn7 + 1;
tb7 := cn7;
tp7 := 35000*cn7;
end;
while r2 = '15' do
begin
cn8 := cn8 + 1;
tb8 := cn8;
tp8 := 35000*cn8;
end;
while r3 = '17' do
begin
cn9 := cn9 + 1;
tb9 := cn9;
tp10 := 35000*cn10;
end;
while r1 = '19' do
begin
cn10 := cn10 + 1;
tb10 := cn10;
tp10 := 35000*cn10;
end;
while r2 = '21' do
begin
cn11:= cn11 + 1;
tb11 := cn11;
tp11 := 35000*cn11;
end;
while r3 = '23' do
begin
cn12 := cn12 + 1;
tb12 := cn12;
tp12 := 35000*cn12;
end;
while r1 = '25' do
begin
cn13 := cn13 + 1;
tb13 := cn13;
tp13 := 35000*cn13;
end;
while r2 = '27' do
begin
cn14 := cn14 + 1;
tb14 := cn14;
tp14 := 35000*cn14;
end;
while r3 = '29' do
begin
cn15 := cn15 + 1;
tb15 := cn15;
tp15 := 35000*cn15;
end;
while r1 = '31' do
begin
cn16 := cn16 + 1;
tb16 := cn16;
tp16 := 35000*cn16;
end;
while r2 = '33' do
begin
cn17 := cn17 + 1;
tb17 := cn17;
tp17 := 35000*cn17;
end;
while r3 = '35' do
begin
cn18 := cn18 + 1;
tb18 := cn18;
tp18 := 35000*cn18;
end;
while r1 = '2' do
begin
cn19 := cn19 + 1;
tb19 := cn19;
tp19 := 35000*cn19;
end;
while r2 = '4' do
begin
cn20 := cn20 + 1;
tb20 := cn20;
tp20 := 35000*cn20;
end;
while r3 = '6' do
begin
cn21 := cn21 + 1;
tb21 := cn21;
tp21 := 35000*cn21;
end;
while r1 = '8' do
begin
cn22 := cn22 + 1;
tb22 := cn22;
tp22 := 35000*cn22;
end;
while r2 = '10' do
begin
cn23 := cn23 + 1;
tb23 := cn23;
tp23 := 35000*cn23;
end;
while r3 = '12' do
begin
cn24 := cn24 + 1;
tb24 := cn24;
tp24 := 35000*cn24;
end;
while r1 = '14' do
begin
cn25 := cn25 + 1;
tb25 := cn25;
tp25 := 35000*cn25;
end;
while r2 = '16' do
begin
cn26 := cn26 + 1;
tb26 := cn26;
tp26 := 35000*cn26;
end;
while r3 = '18' do
begin
cn27 := cn27 + 1;
tb27 := cn27;
tp27 := 35000*cn27;
end;
while r1 = '20' do
begin
cn28 := cn28 + 1;
tb28 := cn28;
tp28 := 35000*cn28;
end;
while r2 = '22' do
begin
cn29 := cn29 + 1;
tb29 := cn29;
tp29 := 35000*cn29;
end;
while r3 = '24' do
begin
cn30 := cn30 + 1;
tb30 := cn30;
tp30 := 35000*cn30;
end;
while r1 = '26' do
begin
cn31 := cn31 + 1;
tb31 := cn31;
tp31 := 35000*cn31;
end;
while r2 = '28' do
begin
cn32 := cn32 + 1;
tb32 := cn32;
tp32 := 35000*cn32;
end;
while r3 = '30' do
begin
cn33 := cn3 + 1;
tb33 := cn33;
tp33 := 35000*cn33;
end;
while r1 = '32' do
begin
cn34 := cn34 + 1;
tb34 := cn34;
tp34 := 35000*cn34;
end;
while r2 = '34' do
begin
cn35 := cn35 + 1;
tb35 := cn35;
tp35 := 35000*cn35;
end;
while r3 = '36' do
begin
cn36 := cn36 + 1;
tb36 := cn36;
tp36 := 35000*cn36;
end;
with lv_lista.Items.Add do
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(f1);
SubItems.Add(q1);
SubItems.Add(b1);
SubItems.Add(s1);
SubItems.Add(h1);
SubItems.Add(g1);
SubItems.Add(pro1);
SubItems.Add(monto1);
SubItems.Add(r1);
SubItems.Add(f2);
SubItems.Add(q2);
SubItems.Add(b2);
SubItems.Add(s2);
SubItems.Add(h2);
SubItems.Add(g2);
SubItems.Add(pro2);
SubItems.Add(monto2);
SubItems.Add(r2);
SubItems.Add(f3);
SubItems.Add(q3);
SubItems.Add(b3);
SubItems.Add(s3);
SubItems.Add(h3);
SubItems.Add(g3);
SubItems.Add(pro3);
SubItems.Add(monto3);
SubItems.Add(r3);
end;
with ListView1.Items.Add do
IF r1 = IntToStr(1) then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit1.Text := IntToStr(tp1);
Edit2.Text := IntToStr(cn1);
end;
with ListView2.Items.Add do
IF r2 = IntToStr(3) then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit3.Text := IntToStr(tp2);
Edit4.Text := IntToStr(cn2);
end;
with ListView3.Items.Add do
IF r3 = IntToStr(5) then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit5.Text := IntToStr(tp3);
Edit6.Text := IntToStr(cn3);
end;
with ListView4.Items.Add do
IF r1 = IntToStr(7) then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit7.Text := IntToStr(tp4);
Edit8.Text := IntToStr(cn4);
end;
with ListView5.Items.Add do
IF r2 = IntToStr(9) then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit9.Text := IntToStr(tp5);
Edit10.Text := IntToStr(cn5);
end;
with ListView6.Items.Add do
IF r3 = IntToStr(11) then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit11.Text := IntToStr(tp6);
Edit12.Text := IntToStr(cn6);
end;
with ListView7.Items.Add do
if r1 = IntToStr(13) then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit13.Text := IntToStr(tp7);
Edit14.Text := IntToStr(cn7);
end;
with ListView8.Items.Add do
while r2 = '15' do
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit15.Text := IntToStr(tp8);
Edit16.Text := IntToStr(cn8);
end;
with ListView9.Items.Add do
IF r3 = '17' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit17.Text := IntToStr(tp9);
Edit18.Text := IntToStr(cn9);
end;
with ListView10.Items.Add do
IF r1 = '19' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit19.Text := IntToStr(tp10);
Edit20.Text := IntToStr(cn10);
end;
with ListView11.Items.Add do
IF r2 = '21' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit21.Text := IntToStr(tp11);
Edit22.Text := IntToStr(cn11);
end;
with ListView12.Items.Add do
IF r3 = '23' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit23.Text := IntToStr(tp12);
Edit24.Text := IntToStr(cn12);
end;
with ListView13.Items.Add do
IF r1 = '25' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit25.Text := IntToStr(tp13);
Edit26.Text := IntToStr(cn13);
end;
with ListView14.Items.Add do
IF r2 = '27' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit27.Text := IntToStr(tp14);
Edit28.Text := IntToStr(cn14);
end;
with ListView15.Items.Add do
IF r3 = '29' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit29.Text := IntToStr(tp15);
Edit30.Text := IntToStr(cn15);
end;
with ListView16.Items.Add do
IF r1 = '31' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit31.Text := IntToStr(tp16);
Edit32.Text := IntToStr(cn16);
end;
with ListView17.Items.Add do
IF r2 = '33' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit33.Text := IntToStr(tp17);
Edit34.Text := IntToStr(cn17);
end;
with ListView18.Items.Add do
IF r3 = '35' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit35.Text := IntToStr(tp18);
Edit36.Text := IntToStr(cn18);
end;
with ListView19.Items.Add do
IF r1 = '2' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit37.Text := IntToStr(tp19);
Edit38.Text := IntToStr(cn19);
end;
with ListView20.Items.Add do
IF r2 = '4' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit39.Text := IntToStr(tp20);
Edit40.Text := IntToStr(cn20);
end;
with ListView21.Items.Add do
IF r3 = '6' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit41.Text := IntToStr(tp21);
Edit42.Text := IntToStr(cn21);
end;
with ListView22.Items.Add do
IF r1 = '8' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit43.Text := IntToStr(tp22);
Edit44.Text := IntToStr(cn22);
end;
with ListView23.Items.Add do
IF r2 = '10' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit45.Text := IntToStr(tp23);
Edit46.Text := IntToStr(cn23);
end;
with ListView24.Items.Add do
IF r3 = '12' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit47.Text := IntToStr(tp24);
Edit48.Text := IntToStr(cn24);
end;
with ListView25.Items.Add do
IF r1 = '14' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit49.Text := IntToStr(tp25);
Edit50.Text := IntToStr(cn25);
end;
with ListView26.Items.Add do
IF r2 = '16' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit51.Text := IntToStr(tp26);
Edit52.Text := IntToStr(cn26);
end;
with ListView27.Items.Add do
IF r3 = '18' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit53.Text := IntToStr(tp27);
Edit54.Text := IntToStr(cn27);
end;
with ListView28.Items.Add do
IF r1 = '20' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit55.Text := IntToStr(tp28);
Edit56.Text := IntToStr(cn28);
end;
with ListView29.Items.Add do
IF r2 = '22' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit57.Text := IntToStr(tp29);
Edit58.Text := IntToStr(cn29);
end;
with ListView30.Items.Add do
IF r3 = '24' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit59.Text := IntToStr(tp30);
Edit60.Text := IntToStr(cn30);
end;
with ListView31.Items.Add do
IF r1 = '26' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit61.Text := IntToStr(tp31);
Edit62.Text := IntToStr(cn31);
end;
with ListView32.Items.Add do
IF r2 = '28' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit63.Text := IntToStr(tp32);
Edit64.Text := IntToStr(cn32);
end;
with ListView33.Items.Add do
IF r3 = '30' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit65.Text := IntToStr(tp33);
Edit66.Text := IntToStr(cn33);
end;
with ListView34.Items.Add do
IF r1 = '32' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit67.Text := IntToStr(tp34);
Edit68.Text := IntToStr(cn34);
end;
with ListView35.Items.Add do
IF r2 = '34' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit69.Text := IntToStr(tp35);
Edit70.Text := IntToStr(cn35);
end;
with ListView36.Items.Add do
IF r3 = '36' then
begin
SubItems.Add(IntToStr(i));
SubItems.Add(codigo);
SubItems.Add(nombre);
SubItems.Add(grado);
SubItems.Add(pro1);
SubItems.Add(monto1);
Edit71.Text := IntToStr(tp36);
Edit72.Text := IntToStr(cn36);
end;
end;
end;
end.
Formulario de registro 1
unit u_registro1;
{$mode objfpc}{$H+}
interface
uses
Spin;
type
{ TFRegistro }
TFRegistro = class(TForm)
b11: TFloatSpinEdit;
b12: TFloatSpinEdit;
b13: TFloatSpinEdit;
b_calcular_1: TButton;
b_registrar_1: TButton;
cb_grado: TComboBox;
e_codigo: TEdit;
e_nombre_y_apellido: TEdit;
f11: TFloatSpinEdit;
f12: TFloatSpinEdit;
f13: TFloatSpinEdit;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
GroupBox5: TGroupBox;
GroupBox6: TGroupBox;
GroupBox7: TGroupBox;
GroupBox8: TGroupBox;
GroupBox9: TGroupBox;
h11: TFloatSpinEdit;
h12: TFloatSpinEdit;
h13: TFloatSpinEdit;
Label1: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label2: TLabel;
Label24: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
monto11: TFloatSpinEdit;
monto12: TFloatSpinEdit;
monto13: TFloatSpinEdit;
pro11: TFloatSpinEdit;
pro12: TFloatSpinEdit;
pro13: TFloatSpinEdit;
q11: TFloatSpinEdit;
q12: TFloatSpinEdit;
q13: TFloatSpinEdit;
r1: TEdit;
r2: TFloatSpinEdit;
r3: TFloatSpinEdit;
s11: TFloatSpinEdit;
s12: TFloatSpinEdit;
s13: TFloatSpinEdit;
private
public
bregistro1 : boolean;
procedure limpiar;
end;
var
FRegistro: TFRegistro;
F1, F2, F3, Q1, Q2, Q3, B1, B2, B3, S1, S2, S3, H1, H2, H3, PRO1, PRO2, PRO3 : Real;
implementation
{$R *.lfm}
{ TFRegistro }
begin
Result := e_nombre_y_apellido.Text;
end;
begin
Result := e_codigo.Text;
end;
begin
Result := cb_grado.Text;
end;
begin
Result := f11.Text;
end;
begin
Result := q11.Text;
end;
begin
Result := b11.Text;
end;
function TFRegistro.obtenerSalud_1: String;
begin
Result := s11.Text;
end;
begin
Result := h11.Text;
end;
begin
Result := pro11.Text;
end;
begin
Result := monto11.Text;
end;
begin
Result := r1.Text;
end;
function TFRegistro.obtenerFisica_2: String;
begin
Result := f12.Text;
end;
begin
Result := q12.Text;
end;
begin
Result := b12.Text;
end;
begin
Result := s12.Text;
end;
begin
Result := h12.Text;
end;
Result := pro12.Text;
end;
begin
Result := monto12.Text;
end;
begin
Result := r2.Text;
end;
begin
Result := f13.Text;
end;
begin
Result := q13.Text;
end;
begin
Result := b13.Text;
end;
begin
Result := s13.Text;
end;
begin
Result := h13.Text;
end;
begin
Result := pro13.Text;
end;
begin
Result := monto13.Text;
end;
begin
Result := r3.Text;
end;
procedure TFRegistro.limpiar;
begin
e_codigo.Text:='';
e_nombre_y_apellido.Text:='';
cb_grado.Text:='';
f11.Text:='';
q11.Text:='';
b11.Text:='';
s11.Text:='';
h11.Text:='';
pro11.Text:='';
monto11.Text:='';
r1.Text:='';
f12.Text:='';
q12.Text:='';
b12.Text:='';
s12.Text:='';
h12.Text:='';
pro12.Text:='';
monto12.Text:='';
r2.Text:='';
f13.Text:='';
q13.Text:='';
b13.Text:='';
s13.Text:='';
h13.Text:='';
pro13.Text:='';
monto13.Text:='';
r3.Text:='';
end;
begin
begin
{ TFRegistro }
bregistro1 := True;
Close;
end
else
begin
MessageDlg('Informacion','Por favor llene todos los campos referentes a las notas,código, nombre y
apellido y grado, luego presione calcular', mtWarning, [mbYes], 0);
end;
end;
begin
if (f11.Caption >= '1' ) and (f12.Caption >= '1' ) and (f13.Caption >= '1' ) and
(q11.Caption >= '1' ) and (q12.Caption >= '1' ) and (q13.Caption >= '1' ) and
(b11.Caption >= '1' ) and (b12.Caption >= '1' ) and (b13.Caption >= '1' ) and
(s11.Caption >= '1' ) and (s12.Caption >= '1' ) and (s13.Caption >= '1' ) and
(h11.Caption >= '1' ) and (h12.Caption >= '1' ) and (h13.Caption >= '1' ) and
(cb_grado.Text<>'' ) then
begin
F1 := f11.Value;
Q1 := q11.Value;
B1 := b11.Value;
S1 := s11.Value;
H1 := h11.Value;
F2 := f12.Value;
Q2 := q12.Value;
B2 := b12.Value;
S2 := s12.Value;
H2 := h12.Value;
F3 := f13.Value;
Q3 := q13.Value;
B3 := b13.Value;
S3 := s13.Value;
H3 := h13.Value;
{ b_calcular_1 el promedio }
{ Mostrar el promedio }
pro11.Caption := FloatToStr(PRO1);
pro12.Caption := FloatToStr(PRO2);
pro13.Caption := FloatToStr(PRO3);
{ Asignacion de beca }
if ((pro11.Text >= '18.00' ) or (pro11.Text <= '20.00')) and (cb_grado.Text = '1ro') then
begin
monto11.Caption := FloatToStr(55000);
r1.Caption := FloatToStr(1);
end
else
if ((pro11.Text >= '16.00 ') or (pro11.Text <= '17.99') ) and (cb_grado.Text = '1ro') then
begin
monto11.Caption := FloatToStr(35000);
r1.Caption := FloatToStr(2);
end
else
if ((pro11.Text >= '1') or (pro11.Text <= '15.99')) and (cb_grado.Text = '1ro') then
begin
monto11.Caption := FloatToStr(0.00);
r1.Caption := FloatToStr(65);
end;
if ((pro12.Text >= '18.00 ') or (pro12.Text <= '20.00 ')) and (cb_grado.Text = '1ro') THEN
begin
monto12.Caption := FloatToStr(55000);
r2.Caption := FloatToStr(3);
end
else
if ((pro12.Text >= '16.00 ') or (pro12.Text <= '17.99')) and (cb_grado.Text = '1ro') THEN
begin
monto12.Caption := FloatToStr(35000);
r2.Caption := FloatToStr(4);
end
else
if ((pro12.Text >= '1') or (pro12.Text <= '15.99' )) and (cb_grado.Text = '1ro') THEN
begin
monto12.Caption := FloatToStr(0.00);
r2.Caption := FloatToStr(65);
end;
if ((pro13.Text >= '18.00 ') or (pro13.Text <= '20.00 ')) and (cb_grado.Text = '1ro') THEN
begin
monto13.Caption := FloatToStr(55000);
r3.Caption := FloatToStr(5);
end
else
if ((pro13.Text >= '16.00 ') or (pro13.Text <= '17.99')) and (cb_grado.Text = '1ro') THEN
begin
monto13.Caption := FloatToStr(35000);
r3.Caption := FloatToStr(6);
end
else
if ((pro13.Text >= '1') or (pro13.Text <= '15.99')) and (cb_grado.Text = '1ro') THEN
begin
monto13.Caption := FloatToStr(0.00);
r3.Caption := FloatToStr(65);
end
else
if ((pro11.Text >= '18.00 ') or (pro11.Text <= '20.00 ')) and (cb_grado.Text = '2do') THEN
begin
monto11.Caption := FloatToStr(60000);
r1.Caption := FloatToStr(7);
end
else
if ((pro11.Text >= '16.00 ') or (pro11.Text <= '17.99') ) and (cb_grado.Text = '2do') THEN
begin
monto11.Caption := FloatToStr(40000);
r1.Caption := FloatToStr(8);
end
else
if ((pro11.Text >= '1') or (pro11.Text <= '15.99')) and (cb_grado.Text = '2do') THEN
begin
monto11.Caption := FloatToStr(0.00);
r1.Caption := FloatToStr(65);
end;
if ((pro12.Text >= '18.00 ') or (pro12.Text <= '20')) and (cb_grado.Text = '2do') THEN
begin
monto12.Caption := FloatToStr(60000);
r2.Caption := FloatToStr(9);
end
else
if ((pro12.Text >= '16.00 ') or (pro12.Text <= '17.99')) and (cb_grado.Text = '2do') THEN
begin
monto12.Caption := FloatToStr(40000);
r2.Caption := FloatToStr(10);
end
else
if ((pro12.Text >= '1') or (pro12.Text <= '15.99' )) and (cb_grado.Text = '2do') THEN
begin
monto12.Caption := FloatToStr(0.00);
r2.Caption := FloatToStr(65);
end;
if ((pro13.Text >= '18.00 ') or (pro13.Text <= '20.00 '))and (cb_grado.Text = '2do') THEN
begin
monto13.Caption := FloatToStr(60000);
r3.Caption := FloatToStr(11);
end
else
if ((pro13.Text >= '16.00 ') or (pro13.Text <= '17.99')) and (cb_grado.Text = '2do') THEN
begin
monto13.Caption := FloatToStr(40000);
r3.Caption := FloatToStr(12);
end
else
if ((pro13.Text >= '1') or (pro13.Text <= '15.99')) and (cb_grado.Text = '2do') THEN
begin
monto13.Caption := FloatToStr(0.00);
r3.Caption := FloatToStr(65);
end
else
if ((pro11.Text >= '18.00 ' ) or (pro11.Text <= '20.00 ')) and (cb_grado.Text = '3ro') THEN
begin
monto11.Caption := FloatToStr(65000);
r1.Caption := FloatToStr(13);
end
else
if ((pro11.Text >= '16.00 ') or (pro11.Text <= '17.99') ) and (cb_grado.Text = '3ro') THEN
begin
monto11.Caption := FloatToStr(45000);
r1.Caption := FloatToStr(14);
end
else
if ((pro11.Text >= '1') or (pro11.Text <= '15.99')) and (cb_grado.Text = '3ro') THEN
begin
monto11.Caption := FloatToStr(0.00);
r1.Caption := FloatToStr(65);
end;
if ((pro12.Text >= '18.00 ') or (pro12.Text <= '20.00 ')) and (cb_grado.Text = '3ro') THEN
begin
monto12.Caption := FloatToStr(65000);
r2.Caption := FloatToStr(15);
end
else
if ((pro12.Text >= '16.00 ') or (pro12.Text <= '17.99')) and (cb_grado.Text = '3ro') THEN
begin
monto12.Caption := FloatToStr(45000);
r2.Caption := FloatToStr(16);
end
else
if ((pro12.Text >= '1') or (pro12.Text <= '15.99' )) and (cb_grado.Text = '3ro') THEN
begin
monto12.Caption := FloatToStr(0.00);
r2.Caption := FloatToStr(65);
end;
if ((pro13.Text >= '18.00 ') or (pro13.Text <= '20.00 ')) and (cb_grado.Text = '3ro') THEN
begin
monto13.Caption := FloatToStr(65000);
r3.Caption := FloatToStr(17);
end
else
if ((pro13.Text >= '16.00 ') or (pro13.Text <= '17.99')) and (cb_grado.Text = '3ro') THEN
begin
monto13.Caption := FloatToStr(45000);
r3.Caption := FloatToStr(18);
end
else
if ((pro13.Text >= '1') or (pro13.Text <= '15.99')) and (cb_grado.Text = '3ro') THEN
begin
monto13.Caption := FloatToStr(0.00);
r3.Caption := FloatToStr(65);
end
end
else
begin
MessageDlg('Informacion',
'Por favor llene todos los campos referentes a las notas en el panel ESTUDIANTE y seleccione el
grado, luego presione calcular.', mtWarning, [mbYes], 0);
end ;
end;
end.
Formulario de registro 2
unit u_registro2;
{$mode objfpc}{$H+}
Interface
uses
Spin;
type
{ TFRegistro_2 }
TFRegistro_2 = class(TForm)
b21: TFloatSpinEdit;
b22: TFloatSpinEdit;
b23: TFloatSpinEdit;
b_calcular_2: TButton;
b_registrar_2: TButton;
cb_grado: TComboBox;
e_codigo: TEdit;
e_nombre1: TEdit;
f21: TFloatSpinEdit;
f22: TFloatSpinEdit;
f23: TFloatSpinEdit;
g21: TFloatSpinEdit;
g22: TFloatSpinEdit;
g23: TFloatSpinEdit;
GroupBox10: TGroupBox;
GroupBox11: TGroupBox;
GroupBox12: TGroupBox;
GroupBox13: TGroupBox;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
GroupBox9: TGroupBox;
h21: TFloatSpinEdit;
h22: TFloatSpinEdit;
h23: TFloatSpinEdit;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
monto21: TFloatSpinEdit;
monto22: TFloatSpinEdit;
monto23: TFloatSpinEdit;
pro21: TFloatSpinEdit;
pro22: TFloatSpinEdit;
pro23: TFloatSpinEdit;
q21: TFloatSpinEdit;
q22: TFloatSpinEdit;
q23: TFloatSpinEdit;
r1: TFloatSpinEdit;
r2: TFloatSpinEdit;
r3: TFloatSpinEdit;
s21: TFloatSpinEdit;
s22: TFloatSpinEdit;
s23: TFloatSpinEdit;
private
public
bregistro2 : boolean;
procedure limpiar;
end;
var
FRegistro_2: TFRegistro_2;
F1, F2, F3, Q1, Q2, Q3, B1, B2, B3, S1, S2, S3, H1, H2, H3, G1, G2,
implementation
{$R *.lfm}
{ TFRegistro_2 }
begin
Result := e_nombre1.Text;
end;
begin
Result := e_codigo.Text;
end;
begin
Result := cb_grado.Text;
end;
begin
Result := f21.Text;
end;
begin
Result := q21.Text;
end;
begin
Result := b21.Text;
end;
begin
Result := s21.Text;
end;
begin
Result := h21.Text;
end;
begin
Result := g21.Text;
end;
begin
Result := pro21.Text;
end;
Result := monto21.Text;
end;
begin
Result := r1.Text;
end;
begin
Result := f22.Text;
end;
begin
Result := q22.Text;
end;
begin
Result := b22.Text;
end;
begin
Result := s22.Text;
end;
begin
Result := h22.Text;
end;
begin
Result := g22.Text;
end;
begin
Result := pro22.Text;
end;
begin
Result := monto22.Text;
end;
begin
Result := r2.Text;
end;
begin
Result := f23.Text;
end;
begin
Result := q23.Text;
end;
Result := b23.Text;
end;
begin
Result := s23.Text;
end;
begin
Result := h23.Text;
end;
begin
Result := g23.Text;
end;
begin
Result := pro23.Text;
end;
begin
Result := monto23.Text;
end;
begin
Result := r3.Text
end;
procedure TFRegistro_2.limpiar;
begin
e_nombre1.Text:= '';
e_codigo.Text:= '';
cb_grado.Text:= '';
f21.Text:='';
q21.Text:='';
b21.Text:='';
s21.Text:='';
h21.Text:='';
g21.Text:='';
pro21.Text:='';
monto21.Text:='';
r1.Text:='';
f22.Text:='';
q22.Text:='';
b22.Text:='';
s22.Text:='';
h22.Text:='';
g22.Text:='';
pro22.Text:='';
monto22.Text:='';
r2.Text:='';
f23.Text:='';
q23.Text:='';
b23.Text:='';
s23.Text:='';
h23.Text:='';
g23.Text:='';
pro23.Text:='';
monto23.Text:='';
r3.Text:='';
end;
begin
begin
{ TFRegistro_2 }
bregistro2 := True;
Close;
end
else
begin
MessageDlg('Informacion','Por favor llene todos los campos referentes a las notas,código, nombre y
apellido y grado, luego presione calcular', mtWarning, [mbYes], 0);
end;
end;
begin
if (f21.Caption >= '1' ) and (f22.Caption >= '1' ) and (f23.Caption >= '1' ) and
(q21.Caption >= '1' ) and (q22.Caption >= '1' ) and (q23.Caption >= '1' ) and
(b21.Caption >= '1' ) and (b22.Caption >= '1' ) and (b23.Caption >= '1' ) and
(s21.Caption >= '1' ) and (s22.Caption >= '1' ) and (s23.Caption >= '1' ) and
(h21.Caption >= '1' ) and (h22.Caption >= '1' ) and (h23.Caption >= '1' ) and
(g21.Caption >= '1' ) and (g22.Caption >= '1' ) and (g23.Caption >= '1' )
begin
F1 := f21.Value;
Q1 := q21.Value;
B1 := b21.Value;
S1 := s21.Value;
H1 := h21.Value;
G1 := g21.Value;
F2 := f22.Value;
Q2 := q22.Value;
B2 := b22.Value;
S2 := s22.Value;
H2 := h22.Value;
G2 := g22.Value;
F3 := f23.Value;
Q3 := q23.Value;
B3 := b23.Value;
S3 := s23.Value;
H3 := h23.Value;
G3 := g23.Value;
{ calcular_11 el promedio }
{ Mostrar el promedio }
pro21.Caption := FloatToStr(PRO1);
pro22.Caption := FloatToStr(PRO2);
pro23.Caption := FloatToStr(PRO3);
{ Asignacion de beca }
if ((pro21.Text >= '18' ) or (pro21.Text <= '20')) and (cb_grado.Text = '4to') then
begin
monto21.Caption := FloatToStr(70000);
r1.Caption := FloatToStr(19);
end
else
if ((pro21.Text >= '16') or (pro21.Text <= '17.99') )and (cb_grado.Text = '4to') THEN
begin
monto21.Caption := FloatToStr(75000);
r1.Caption := FloatToStr(20);
end
else
if ((pro21.Text >= '1') or (pro21.Text <= '15.99')) and (cb_grado.Text = '4to') then
begin
monto21.Caption := FloatToStr(0.00);
r1.Caption := FloatToStr(65);
end;
if ((pro22.Text >= '18') or (pro22.Text <= '20')) and (cb_grado.Text = '4to') THEN
begin
monto22.Caption := FloatToStr(70000);
r2.Caption := FloatToStr(21);
end
else
if ((pro22.Text >= '16') or (pro22.Text <= '17.99')) and (cb_grado.Text = '4to') THEN
begin
monto22.Caption := FloatToStr(50000);
r2.Caption := FloatToStr(22);
end
else
if ((pro22.Text >= '1') or (pro22.Text <= '15.99' )) and (cb_grado.Text = '4to') THEN
begin
monto22.Caption := FloatToStr(0.00);
r2.Caption := FloatToStr(65);
end;
if ((pro23.Text >= '18') or (pro23.Text <= '20')) and (cb_grado.Text = '4to') THEN
begin
monto23.Caption := FloatToStr(70000);
r3.Caption := FloatToStr(23);
end
else
if ((pro23.Text >= '16') or (pro23.Text <= '17.99')) and (cb_grado.Text = '4to') THEN
begin
monto23.Caption := FloatToStr(50000);
r3.Caption := FloatToStr(24);
end
else
if ((pro23.Text >= '1') or (pro23.Text <= '15.99')) and (cb_grado.Text = '4to') THEN
begin
monto23.Caption := FloatToStr(0.00);
r2.Caption := FloatToStr(65);
end
else
if ((pro21.Text >= '18' ) or (pro21.Text <= '20')) and (cb_grado.Text = '5to') then
begin
monto21.Caption := FloatToStr(70000);
r1.Caption := FloatToStr(25);
end
else
if ((pro21.Text >= '16') or (pro21.Text <= '17.99') )and (cb_grado.Text = '5to') THEN
begin
monto21.Caption := FloatToStr(75000);
r1.Caption := FloatToStr(26);
end
else
if ((pro21.Text >= '1') or (pro21.Text <= '15.99')) and (cb_grado.Text = '5to') then
begin
r1.Caption := FloatToStr(65);
end;
if ((pro22.Text >= '18') or (pro22.Text <= '20')) and (cb_grado.Text = '5to') THEN
begin
monto22.Caption := FloatToStr(75000);
r2.Caption := FloatToStr(27);
end
else
if ((pro22.Text >= '16') or (pro22.Text <= '17.99')) and (cb_grado.Text = '5to') THEN
begin
monto22.Caption := FloatToStr(55000);
r2.Caption := FloatToStr(28);
end
else
if ((pro22.Text >= '1') or (pro22.Text <= '15.99')) and (cb_grado.Text = '5to') THEN
begin
monto22.Caption := FloatToStr(0.00);
r2.Caption := FloatToStr(65);
end;
if ((pro23.Text >= '18') or (pro23.Text <= '20')) and (cb_grado.Text = '5to') THEN
begin
monto23.Caption := FloatToStr(75000);
r3.Caption := FloatToStr(29);
end
else
if ((pro23.Text >= '16') or (pro23.Text <= '17.99')) and (cb_grado.Text = '5to') THEN
begin
monto23.Caption := FloatToStr(55000);
r3.Caption := FloatToStr(30);
end
else
if ((pro23.Text >= '1') or (pro23.Text <= '15.99')) and (cb_grado.Text = '5to') THEN
begin
monto23.Caption := FloatToStr(0.00);
r3.Caption := FloatToStr(65);
end
else
if ((pro21.Text >= '18') or (pro21.Text <= '20')) and (cb_grado.Text = '6to') THEN
begin
monto21.Caption := FloatToStr(70000);
r1.Caption := FloatToStr(31);
end
else
if ((pro21.Text >= '16') or (pro21.Text <= '17.99')) and (cb_grado.Text = '6to') THEN
begin
monto21.Caption := FloatToStr(50000);
r1.Caption := FloatToStr(32);
end
else
if ((pro21.Text >= '1') or (pro21.Text <= '15.99' )) and (cb_grado.Text = '6to') THEN
begin
monto21.Caption := FloatToStr(0);
r1.Caption := FloatToStr(65);
end ;
if ((pro22.Text >= '18') or (pro22.Text <= '20')) and (cb_grado.Text = '6to') THEN
begin
monto22.Caption := FloatToStr(70000);
r2.Caption := FloatToStr(33);
end
else
if ((pro22.Text >= '16') or (pro22.Text <= '17.99')) and (cb_grado.Text = '6to') THEN
begin
monto22.Caption := FloatToStr(50000);
r2.Caption := FloatToStr(34);
end
else
if ((pro22.Text >= '1') or (pro22.Text <= '15.99' )) and (cb_grado.Text = '6to') THEN
begin
monto22.Caption := FloatToStr(0);
r2.Caption := FloatToStr(65);
end;
if ((pro23.Text >= '18') or (pro23.Text <= '20')) and (cb_grado.Text = '6to') THEN
begin
monto23.Caption := FloatToStr(70000);
r3.Caption := FloatToStr(35);
end
else
if ((pro23.Text >= '16') or (pro23.Text <= '17.99')) and (cb_grado.Text = '6to') THEN
begin
monto23.Caption := FloatToStr(50000);
r3.Caption := FloatToStr(36);
end
else
if ((pro23.Text >= '1') or (pro23.Text <= '15.99')) and (cb_grado.Text = '6to') THEN
begin
monto23.Caption := FloatToStr(0);
r3.Caption := FloatToStr(65);
end;
end
else
begin
MessageDlg ('Informacion','Por favor llene todos los campos referentes a las notas en el panel
ESTUDIANTE y seleccione el grado, luego presione calcular.', mtWarning, [mbYes], 0);
end;
end;
end.
Procedimientos consulta, modificar y eliminar datos.3
Para las opciones de modificar y eliminar datos se tiene que abrir el archivo
IniFile para lectura y recorrerlo a fin de encontrar el registro deseado o el fin
del archivo. La función fda (id_arch) detectara el final del archivo con la
lectura de su ultimo registro y se utilizara la función definida por el ususario
igual(clavebus, persona) en la comparación del campo
persona.nombre_campo1 con la clave introducida desde teclado. Para esta
opción se encuentra el registro mediante el campo nombre_campo1
Tipo
registro: datos_personales
<tipo_dato_1>: nombre_campo1
…………………………………………
fin_registro
Var
Arch: f
Datos_personales: persona
<tipo_dato_1> : clavebus
lógico : encontrado;
Inicio
encontrado ← falso;
Leer (clavebus)
Mientras no encontrado y no fda(f) hacer
encontrado ← Verdad
Fin_si
Fin_mientras
Si no encontrado entonces
Si_no
Llamar_a escribir_reg(persona)
Fin_si
Cerrar (f)
Fin .
Tipo
registro: datos_personales
<tipo_dato_1>: nombre_campo1
…………………………………………
fin_registro
archivos_de datos_personales: arch
Var
Arch: f, faux;
lógico : encontrado;
Inicio
leer (personaaux.nombre:campo1)
encontrado ← falso;
encontrado ← Verdad
si_no
fin_si
Fin_mientras
Si no encontrado entonces
Fin_si
Cerrar(f, faux)
Borrar (“PERSONAL”)
Fin .
Tipo
registro: datos_personales
<tipo_dato_1>: nombre_campo1
…………………………………………
fin_registro
Var
Arch: f, faux;
lógico : encontrado;
Inicio
encontrado ← falso;
encontrado ← Verdad
fin_si
Fin_mientras
Si no encontrado entonces
Fin_si
Cerrar(f, faux)
Borrar (“PERSONAL”)
Fin ;
var
carácter : opción
entero : n
inicio
leer (opción )
“R”:
Escribir_reg (persona)
leer_reg (persona)
“C”
Escribir_reg (persona)
Leer (n)
Introducir_campo(n, persona)
Fin_segun
Fin_procedimiento