Este documento presenta las características y código de 5 aplicaciones desarrolladas en Delphi. La primera aplicación calcula el total a pagar de una compra aplicando descuentos. La segunda calcula el promedio, observación y cualidad de un alumno. La tercera y cuarta aplicación permiten ingresar datos de alumnos y trabajadores respectivamente. La quinta aplicación no se describe. El documento incluye etiquetas, controles, propiedades y eventos asociados al código para cada aplicación.
1. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Guía del Participante
LENGUAJE DE PROGRAMACIÓN I
DELPHI
Prof. Teófilo Mamani Benique
Computación e Informática I Semestre
1
2. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Aplicación desa
desarrollada Nº 1
Características
ísticas
Se debe ingresar el nombre de un producto, su precio unitario, y la cantidad
comprada de dicho producto, luego se debe calcular y visualizar el subtotal, el
descuento en porcentaje, el descuento en soles y el total a pagar.
descuento
El descuento en porcentaje se depende del Sub Total de acuerdo a la siguiente
tabla.
Sub Total Descuento %
100 o 101 2%
de 101.1 a 200 4%
de 200.1 a 500 6%
a partir de 500 10%
Dibujar los controles y asignarle propiedades generales
Propiedades
Control
Name Caption
Label1 lblProducto Producto
Label2 lblPU Precio Unitario
Label3 lblCC Cantidad Comprada
Label4 lblSubTotal Sub Total
Label5 lblDesPor Descuento %
Label6 lblDesSol Descuento S/.
Label7 lblTotal TOTAL A PAGAR S/.
Computación e Informática I Semestre
2
3. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Propiedades
Control
Name Text Color
Edit1 edtProducto Nada
Edit2 edtPU Nada
Edit3 edtCC Nada
Edit4 edtSubTotal 0 cl3DLight
Edit5 edtDesPor 0 cl3DLight
Edit6 edtDesSol 0 cl3DLight
Edit7 edtTotal 0 cl3DLight
Propiedades
Control
ntrol
Name Style Height
Bevel1 bvlSeparador bsRaised 3
Propiedades
Control
Name Kind
BitBtn1 bbtnCalcular bkOk
BitBtn2 bbtnNuevo bkRetry
BitBtn3 bbtnSalir bkClose
Asociamos la siguiente codificaci
codificación:
bbtnCalcular evento Click
procedure TfrmVentaProd.bbtnCalcularClick(Sender: TObject);
TfrmVentaProd.bbtnCalcularClick(Sender:
Var
fPreUni,fCanCom,fSubTot,fDesSol,fTotPag:Real;
nDesPor : Integer;
begin
fPreUni:=StrToFloat(edtPU.Text);
fCanCom:=StrToFloat(edtCC.Text);
fSubTot:=fPreUni * fCanCom;
IF (fSubTot >= 0) AND (fSubTot <100) The
Then
Begin
nDesPor := 0;
fDesSol:=0;
End;
IF (fSubTot >= 100) AND (fSubTot <=101) Then
Begin
nDesPor := 2;
fDesSol:=fSubTot * 2 /100;
End;
IF (fSubTot >= 101.1) AND (fSubTot <=200) Then
Begin
nDesPor := 4;
fDesSol:=fSubTot * 4 /100;
End;
Computación e Informática I Semestre
3
4. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
IF (fSubTot >= 200.1) AND (fSubTot <=500) Then
Begin
nDesPor := 6;
fDesSol:=fSubTot * 6 /100;
End;
IF (fSubTot >500) Then
Begin
nDesPor := 10;
fDesSol:=fSubTot * 10 /100;
End;
fTotPag:=fSubTot - fDesSol;
edtSubTotal.Text:=Format('%f',[fSubTot]);
edtDesPor.Text:=IntToStr(nDesPor)+ ' %' ;
edtDesSol.Text:=Format('%f',[fDesSol]);
edtTotal.Text :=Format('%f',[fTotPag]);
end;
bbtnNuevo evento Click
procedure TfrmVentaProd.bbtnNuevoClick(Sender: TObject);
TfrmVentaProd.bbtnNuevoClick(Sender:
begin
edtProducto.Text:='';
edtPU.Text:='';
edtCC.Text:='';
edtSubTotal.Text:='0';
edtDesPor.Text:='0';
edtDesSol.Text:='0';
edtTotal.Text:='0';
edtProducto.SetFocus;
end;
Computación e Informática I Semestre
4
5. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Aplicación desa
desarrollada Nº 2
Características
ísticas
Se debe ingresar el nombre del alumno, su Nota Nro 1 y su Nota Nro 2, al hacer clic
r
en el botón obtener promedio, se debe visualizar: El promedio del alumno, una
Observación que indica si el alumno esta aprobado o desaprobado, la cantidad de
puntos que le faltan para aprobar si está desaprobado, o los puntos para llegar a
aprobar
veinte en caso de que este aprobado. También se debe visualizar la nota cualitativa
del alumno de acuerdo al promedio.
Promedio Cualidad
0 y5 Pésimo
5.1 y 10.4 Malo
10.5 y 14.4 Regular
14.5 y 17.4 Bueno
17.5 y 20 Excelente
Propiedades
Control
Name Caption
Label1 lblAlumno Alumno :
Label2 lblCurso Curso :
Label3 lblNota1 Nota 1 :
Label4 lblNota2 Nota 2 :
Label5 lblPromedio Promedio :
Label6 lblObservacion Observación :
Label7 lblPuntos Puntos :
Label8 lblCualidad Cualidad :
Propiedades
Control
Name Text Color Charcase
Edit1 edtAlumno Nada ecUpperCase
Edit2 edtCurso Nada ecUpperCase
Edit3 edtNota1 Nada
Computación e Informática I Semestre
5
6. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Edit4 edtNota2 Nada
Edit5 edtPromedio 0 cl3DLight
Edit6 edtObservación
edtObse Nada cl3DLight
Edit7 edtPuntos Nada cl3DLight
Edit8 edtCualidad Nada cl3DLight
Propiedades
Control
Name Style Height
Bevel1 bvlSeparador bsRaised 3
Propiedades
Control
Name Caption Enabled
BitBtn1 bbtnOtroAlumno &Otro Alumno False
BitBtn2 bbtnObtenerPromedio Obtener &Promedio False
BitBtn3 bbtnFinalizar &Finalizar True
Asociamos la siguiente codificación
edtNota2 evento Enter
procedure TForm1.edtNota2Enter(Sender: TObject);
Var
N: Integer;
begin
N:=StrToInt(edtNota1.Text);
IF not(N IN[0..20]) THEN
Begin
MessageDlg('Notas entre 1 y 20 Por favor', mtWarning, [mbOk],0);
edtNota1.Text:='0';
edtNota1.Setfocus;
End;
end;
edtAlumno evento Keypress
procedure TForm1.edtAlumnoKeyPress(Sender: TObject; var Key: Char);
begin
bbtnObtenerPromedio.Enabled:=True;
bbtnObtenerPromedio.Enabled:=
end;
bbtnObtenerPromediio evento Click
procedure TForm1.bbtnObtenerPromedioClick(Sender: TObject);
Var
N : Integer;
nN1,nN2 : Integer;
nProm : Integer;
nPuntos : Integer;
begin
N:=StrToInt(edtNota2.Text);
IF not(N IN[0..20]) THEN
Begin
Computación e Informática I Semestre
6
7. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
MessageDlg('Notas entre 1 y 20 Por favor',mtWarning,
entre favor',mtWarning,[mbOk],0);
edtNota2.Text:='0';
edtNota2.Setfocus;
End;
(*Activamos Botones*)
bbtnotroAlumno.Enabled:=True;
bbtnFinalizar.Enabled:=True;
(*Desarrollamos Operaciones*)
nN1:=StrToInt(edtNota1.Text);
nN1:=StrToInt(edtNota1.Text)
nN2:=StrToInt(edtNota2.Text);
nProm:=(nN1 + nN2) Div 2;
edtPromedio.Text:=IntToStr(nProm);
IF (nProm < 11) THEN
Begin
edtObservacion.Text:='Desaprobado';
nPuntos:=11-nProm;
nProm;
edtPuntos.Text:='Te falta '+IntToStr(nPuntos)+' puntos para aprobar';
End
ELSE
Begin
edtObservacion.Text:='Aprobado';
nPuntos:=20-nProm;
nProm;
edtPuntos.Text:='Te falta '+IntToStr(nPuntos)+' puntos para Veinte';
End;
Case nProm Of
0..5 : edtCualidad.Text:='Pésim
edtCualidad.Text:='Pésimo';
6..10 : edtCualidad.Text:='Malo';
11..14 : edtCualidad.Text:='Regular';
15..17 : edtCualidad.Text:='Bueno';
18..20 : edtCualidad.Text:='Excelente';
End;
end;
bbtnOtroAlumno evento Click
procedure TForm1.bbtnOtroAlumnoClick(Sender: TObject);
begin
edtAlumno.Text:='';
tAlumno.Text:='';
edtCurso.Text:='';
edtNota1.Text:='';
edtNota2.Text:='';
edtPromedio.Text:='0';
edtObservacion.Text:='';
edtPuntos.Text:='';
edtCualidad.Text:='';
bbtnOtroalumno.Enabled:=False;
bbtnObtenerPromedio.Enabled:=False;
bbtnObtenerPromedio.Enabled:=Fals
edtAlumno.Setfocus;
end;
Computación e Informática I Semestre
7
8. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
bbtnFinalizar evento Click
procedure TForm1.bbtnFinalizarClick(Sender: TObject);
begin
If MessageDlg('Está seguro que desea salir de la aplicación',
mtConfirmation,[mbYes,mbNo],0)= mrYes Then
Begin
MessageDlg('Terminando la Aplicación',mtInformation, [mbOk],0);
Aplicación',mtInformation,
Close;
End;
end;
Aplicación desa
desarrollada Nº 3
Características
ísticas
Esta aplicación debe permitir al usuario ingresar el
nombre del alumno, su Especialidad y Turno. Al
hacer clic en cualquiera de los combos se debe
desplegar las opciones posi
posibles a elegir.
Dibujar y asignarles propiedades generales a los
controles
Propiedades
Control
Name Caption
Label1 lblAlumno Alumno :
Label2 lblEspecialidad Especialidad :
Label3 lblTurno Turno :
Propiedades
Control
Name Text Color Charcase
Edit1 edtAlumno Nada ecUpperCase
Propiedades
Control
Name Text Ítems
ComboBox1 cboEspecialidad Nada Computación
Administración
Enfermería
Electrónica
Secretariado
ComboBox2 cboTurno Nada Mañana
Tarde
Noche
Computación e Informática I Semestre
8
9. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Propiedades
Control
Name Caption Kind
BitBtn1 bbtnOtroAlumno &Otro Alumno bkCustom
BitBtn2 bbtnFinalizar bkClose
Asociamos la siguiente co
codificación
bbtnOtroAlumno evento Click
procedure TForm1.bbtnOtroAlumnoClick(Sender: TObject);
begin
edtAlumno.Text:='';
cboEspecialidad.Text:='';
cboTurno.Text:='';
edtAlumno.Setfocus;
dtAlumno.Setfocus;
end;
Aplicación desa
desarrollada Nº 4
Características
ísticas
Esta aplicación debe permitir al usuario
ingresar el nombre del Trabajador, su Tipo,
Estado Civil y Categoría. Al hacer clic en
cualquiera de los combos se debe desplegar
las opciones posibles a elegir
elegir.
Tipo: Permanente, Contratado, Eventual
Estado civil: Casado, Soltero, Viudo,
Divorciado
Categoría: A-1, A-2, A-3, B B-2, B-3
3, B-1,
Dibujar y asignarles propiedades generales a
los controles
Computación e Informática I Semestre
9
10. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Propiedades
Control
Name Caption
Label1 lblNombre Nombre :
Label2
abel2 lblTipo Tipo :
Label3 lblEstadoCivil Estado Civil :
Label4 lblCategoria Categoría :
Propiedades
Control
Name Text Color Charcase
Edit1 edtNombre Nada ecUpperCase
Propiedades
Control
Name Text Ítems
ComboBox1 cboTipo Nada Permanente
Contratado
atado
Eventual
ComboBox2 cboEstadoCivil Nada Casado
Soltero
Viudo
Divorciado
ComboBox3 cboCategoria Nada A-1
A-2
A-3
B-1
B-2
B-3
Propiedades
Control
Name Caption Kind
BitBtn1 bbtnIngresarOtro &Ingresar Otro bkCustom
BitBtn2 bbtnSalir bkClose
Asociamos la siguiente c
sociamos codificación
bbtnIngresarOtro evento Click
procedure TForm1.bbtnIngresarOtroClick(Sender: TObject);
begin
edtNombre.Text:='';
cboTipo.Text:='';
cboEstadoCivil.Text:='';
cboCategoria.Text:='';
edtNombre.Setfocus;
end;
Computación e Informática I Semestre
10
11. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Aplicación desa
desarrollada Nº 5
Características
ísticas
La aplicación debe tener las siguientes características:
1. Al ejecutar la aplicación, el gráfico debe estar oculto y el botón Nuevo
l gráfico
desactivado, hasta que se comience a ingresar el nombre del trabajador.
2. El pago por hora se visualizará en forma automática y depende del tipo de
automática
empleado: Permanente S/.15.00; Contratado S/. 10.00 y Eventual S/. 5.00.
3. No existe el botón Calcular, entonces el total a pagar debe visualizarse
automáticamente cuanto el usuario ingrese el número de horas trabajadas o
cambie el tipo de empleado.
Dibujar los controles
Propiedades
Control
Name Caption
Label1 lblNombre Nombre :
Label2 lblTipo Tipo :
Label3 lblPagHor Pago por hora :
Label4 lblHorTra Horas trabajadas :
Label5 lblTotal TOTAL A PAGAR :
Propiedades
Control
Name Text Color Charcase ReadOnly
Edit1 edtNombre Nada - ecUpperCase False
Edit2 edtPagHor Nada cl3DLight - True
Edit3 edtHorTra Nada - - False
Edit4 edtTotal Nada cl3DLight - True
Propiedades
Control
Name Text Ítems
ComboBox1 cboTipo Nada Permanente
Contratado
Eventual
Computación e Informática I Semestre
11
12. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Propiedades
Control
Name Visible Picture
Image1 imgImagen False Load; Seleccione un
archivo(.BMP,.ICO,.JPG)
Propiedades
Control
Name Caption Kind
BitBtn1 bbtnNuevo &Nuevo bkCustom
BitBtn2 bbtnSalir bkClose
Asociamos la siguiente c
iamos codificación
EdtNombre (Evento Change)
procedure TForm1.edtNombreChange(Sender: TObject);
begin
imgImagen.Visible:=True;
end;
cboTipo (Evento Change)
procedure TForm1.cboTipoChange(Sender: TObject);
Var
fPH,fHT,fTotal : Real;
begin
IF cboTipo.Text = 'Permanente' Then
edtPagHor.Text:='15.00';
IF cboTipo.Text = 'Contratado' Then
edtPagHor.Text:='10.00';
IF cboTipo.Text = 'Eventual' Then
edtPagHor.Text:='5.00';
If NOT(edtHorTra.Text='')Then
Begin
fPH:=StrToFloat(edtPagHor.Text);
fHT:=StrToFloat(edtHorTra.Text);
fTotal:=fPH * fHT;
edtTotal.Text:=Format('%f',[fTotal]);
End
end;
edtHorTra (Evento Change)
procedure TForm1.edtHorTraChange(Sender: TObject);
Var
fPH,fHT,fTotal : Real
Real;
begin
If NOT(edtHorTra.Text='')Then
Begin
fPH:=StrToFloat(edtPagHor.Text);
fHT:=StrToFloat(edtHorTra.Text);
Computación e Informática I Semestre
12
13. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
fTotal:=fPH * fHT;
edtTotal.Text:=Format('%f',[fTotal]);
End
Else
Begin
edtHorTra.Text:='0';
edtHorTra.Setfocus;
End;
end;
bbtnNuevo (Evento Click)
procedure TForm1.bbtnNuevoClick(Sender: TObject);
begin
edtNombre.Text:='';
cboTipo.Text:='';
edtPagHor.Text:='';
edtHorTra.Text:='0';
edtTotal.Text:='';
edtNombre.SetFocus;
end;
Aplicación desa
desarrollada Nº 6
Características
ísticas
En esta aplicación si el usuario es soltero debe pedir la edad y el Nro de hermanos y
si es casado debe pedir el tiempo de casado y el Nro de hijos.
Dibujar Controles
Propiedades
Control
Name Caption
Label1 lblNombre Nombre :
Label2 lblEstadoCivil Estado Civil :
Label3 lblEdaTie Edad :
Label4 lblHerHij Nro Hermanos :
Label5 lblTexto Años
Computación e Informática I Semestre
13
14. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Propiedades
Control
Name Text Color Charcase
Edit1 edtNombre Nada ecUpperCase
Edit2 edtEdaTie Nada
Edit3 edtHerHij Nada
Propiedades
Control
Name Ítems Text
ComboBox1 cboEstadoCivil Soltero Nada
Casado
Propiedades
Control
Name Style Height
Bevel1 bvlSeparador bsRaised 3
Propiedades
Control
Name Caption Kind
BitBtn1 bbtnNuevo &Nuevo bkCustom
BitBtn2 bbtnSalir bkClose
Codificación
cboEstadoCivil (Evento Change)
procedure TForm1.cboEstadoCivilChange(Sender: TObject);
begin
If cboEstadoCivil.Text = 'Soltero' Then
Begin
lblEdaTie.Caption:='Edad :';
lblHerHij.Caption:='Nro Hermanos :';
edtEdaTie.Text:='';
edtHerHij.Text:='';
edtEdaTie.Setfocus;
End;
If cboEstadoCivil.Text = 'Casado' Then
Begin
lblEdaTie.Caption:='Tiempo de casado:';
lblHerHij.Caption:='Nro de Hijos :';
edtEdaTie.Text:='';
edtHerHij.Text:='';
edtEdaTie.Setfocus;
tEdaTie.Setfocus;
End;
end;
Computación e Informática I Semestre
14
15. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Aplicación desa
desarrollada Nº 7
Características
ísticas
Esta aplicación debe asignar un curso a cada profesor. Primero se debe ingresar su
asignar
nombre y luego seleccionar el tipo de curso: Aplicativos, Programación y Otros.
Según el tipo de curso se mostrará una lista de cursos.
Aplicativos Programación Otros
Windows Visual Fox Pro Internet
Word Delphi Correo Electrónico
Excel Visual Basic Inglés Técnico
Power Poin
Point Power Builder
Dibujar controles
Propiedades
Control
Name Caption
Label1 lblProfesor Profesor :
Label2 lblTipoC Tipo de Curso :
Label3 lblNombreC Nombre de Curso :
Propiedades
Control
Name Text Charcase
Edit1 edtProfesor Nada ecUpperCase
Propiedades
Control
Name Text Ítems
ComboBox1 cboTipoC Nada Aplicativos
Programación
Otros
ComboBox2 cboNombreC Nada Nada
Computación e Informática I Semestre
15
16. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Propiedades
Control
Name Caption Kind
BitBtn1 bbtnNuevo &Nuevo
tn1 bkCustom
BitBtn2 bbtnSalir bkClose
Codificación
cboTipoC (Change)
procedure TForm1.cboTipo Change(Sender: TObject);
TForm1.cboTipoCChange(Sender:
begin
cboNombreC.Clear;
IF (cboTipoC.Text = 'Aplicativos') THEN
Begin
cboNombreC.Items.Add('Windows');
cboNombreC.Items.Add('Wind
cboNombreC.Items.Add('Word');
cboNombreC.Items.Add('Excel');
cboNombreC.Items.Add('Power Point');
End;
IF (cboTipoC.Text = 'Programación') THEN
Begin
cboNombreC.Items.Add('Visual Fox Pro');
cboNombreC.Items.Add('Delphi');
cboNombreC.I
cboNombreC.Items.Add('Visual Basic');
cboNombreC.Items.Add('Power Builder');
End;
IF (cboTipoC.Text = 'Otros') THEN
Begin
cboNombreC.Items.Add('Internet');
cboNombreC.Items.Add('Correo Electrónico');
Electrónico');
cboNombreC.Items.Add('Inglés Técnico');
End;
end;
bbtnNuevo (Click)
procedure TForm1.bbtnNuevoClick(Sender: TObject);
begin
edtProfesor.Text:='';
cboTipoC.Text:='';
cboNombreC.Text:='';
edtProfesor.Setfocus;
end;
Computación e Informática I Semestre
16
17. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Aplicación desa
desarrollada Nº 8
Características
ísticas
Una empresa de venta de computadoras necesita un formulario que permita realizar
su pro forma. Dicha empresa tiene los siguientes productos:
Computadoras Precio Impresoras Precio
IBM 850.00 Epson LX-300 180.00
Packer Bell 700.00 Deskject 400 270.00
Acer 600.00 IBMGraphics 380.00
Dibujar los controles
Propiedades
Control
Name Caption Font/Size
Label1 lblProforma PROFORMA 14
Label2 lblFecha Fecha
Label3 lblCliente Cliente :
Label4 lblDireccion Dirección :
Label5 lblComputadoras Computadoras :
lblC
Label6 lblImpresoras Impresoras :
Label7 lblSubTotal Sub Total :
Label8 lblIGV IGV 19% :
Label9 lblTotal TOTAL :
Propiedades
Control
Name Text Color ReadOnly
Edit1 edtCliente Nada False
Edit2 edtDireccion Nada False
alse
Edit3 edtPreCom Nada cl3DLight True
Edit4 edtPreImp Nada cl3DLight True
Edit5 edtSubTotal 0 cl3DLight True
Edit6 edtIGV 0 cl3DLight True
Edit7 edtTotal 0 cl3DLight True
Computación e Informática I Semestre
17
18. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Propiedades
Control
Name Text Ítems
ComboBox1 cboComputadoras Nada IBM
Packer Bell
acker
Acer
ComboBox2 cboImpresoras Nada Epson LXLX-300
Deskject 400
IBMGraphics
Propiedades
Control
Name Style Height
Bevel1 bvlSeparador1 bsRaised 3
Bevel2 bvlSeparador2 bsRaised 3
Propiedades
Control
Name Caption Kind
BitBtn1 bbtnCalcular &Calcular bkCustom
BitBtn2 bbtnOtraPro &Otra proforma bkCustom
BitBtn3 bbtnSalir Nada bkClose
Codificación
cboComputadoras (Change
Change)
procedure TForm1.cboComputadorasChange(Sender: TObject);
begin
IF (cboComputadoras.Text = 'IBM') THEN
edtPreCom.Text:='850.00';
eCom.Text:='850.00';
IF (cboComputadoras.Text = 'Packer Bell') THEN
edtPreCom.Text:='700.00';
IF (cboComputadoras.Text = 'Acer') THEN
edtPreCom.Text:='600.00';
end;
cboImpresoras (Change
Change)
procedure TForm1.cboImpresorasChange(Sender: TObj
TObject);
begin
IF (cboImpresoras.Text = 'Epson LX 300') THEN
LX-300')
edtPreImp.Text:='180.00';
IF (cboImpresoras.Text = 'Deskject 400') THEN
edtPreImp.Text:='270.00';
IF (cboImpresoras.Text = 'IBMGraphics') THEN
edtPreImp.Text:='380.00';
end;
bbtnCalcular (Click)
procedure TForm1.bbtnCalcularClick(Sender: TObject);
Var
fPreCom,fPreImp : Real;
fSubTotal,fIGV,fTotal : Real;
Computación e Informática I Semestre
18
19. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
begin
fPreCom:=StrToFloat(edtPreCom.Text);
fPreImp:=StrToFloat(edtPreImp.Text);
fSubTotal:=fPreCom + fPre
fPreImp;
fIGV:=fSubTotal * 19 / 100;
fTotal:=fSubTotal+fIGV;
edtSubTotal.Text:=Format('%f',[fSubTotal]);
edtIGV.Text:=Format('%f',[fIGV]);
edtTotal.Text:=Format('%f',[fTotal]);
end;
bbtnOtraPro (Click)
procedure TForm1.bbtnOtraProClick(Sender: TObject);
begin
edtCliente.Text:='';
edtDireccion.Text:='';
cboComputadoras.Text:='';
cboImpresoras.Text:='';
edtPreCom.Text:='';
edtPreImp.Text:='';
edtSubTotal.Text:='0';
edtIGV.Text:='0';
edtTotal.Text:='0';
edtCliente.Setfocus;
ocus;
end;
Aplicación desa
desarrollada Nº 9
Características
ísticas
Esta aplicación debe permitir si es soltero pedir la edad y el número de hermanos y
su sueldo debe ser de S/. 200.00. Si es casado debe pedir el tiempo de casado y el
Nro de Hijos y su sueldo debe ser de S/. 250.00.
Computación e Informática I Semestre
19
20. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Propiedades
Control
Name Caption
Label1 lblNombre Nombre :
Label2 lblSueldo Sueldo :
Label3 lblEdaTie Edad :
Label4 lblHerHij Nro. de Hermanos :
Label5 lblTexto Años
Propiedades
Control
Name Text Color ReadOnly
Edit1 edtNombre Nada False
Edit2 edtSueldo Nada cl3DLight True
Edit3 edtEdaTie Nada False
Edit4 edtHerHij Nada False
Propiedades
Control
Name Caption
RadioGroup1 rgpEstadoCivil Estado Civil
Propiedades
Control
Name Caption
RadioButton1 rbtSoltero Soltero (a)
RadioButton2 rbtCasado Casado (a)
Propiedades
Control
Name Style Height
Bevel1 bvlSeparador bsRaised 3
Propiedades
Control
Name Caption Kind
BitBtn1 bbtnNuevo &Nuevo bkCustom
BitBtn2 bbtnSalir Nada bkClose
Codificacion
rbtSoltero (Click)
procedure TForm1.rbtSolteroClick(Sender: TObject);
begin
edtSueldo.Text:='200.00';
lblEdaTie.Caption:='Edad :';
lblHerHij.Caption:='Nro de Hermanos :';
edtEdaTie.Setfocus;
end;
rbtCasado (Click)
procedure TForm1.rbtCasadoClick(Sender: TObject);
begin
Computación e Informática I Semestre
20
21. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
edtSueldo.Text:='250.00';
lblEdaTie.Caption:='Tiempo de casados :';
lblHerHij.Caption:='Nro de Hijos :';
edtEdaTie.Setfocus;
end;
bbtnNuevo (Click)
procedure TForm1.bbtnNuevoClick(Sender: TObject);
begin
edtNombre.Text:='';
edtSueldo.Text:='';
edtEdaTie.Text:='';
edtHerHij.Text:='';
rbtSoltero.Checked:=False;
rbtCasado.Checked:=False;
edtNombre.Setfocus;
end;
Aplicación desa
desarrollada Nº 10
Características
ísticas
Esta aplicación permite ingresar los valores numéricos y según el bo
ermite numéricos botón de opción
que se elija, se mostrará el resultado:
Propiedades
Control
Name Caption
Label1 lblNumero1 Numero 1 :
Label2 lblNumero2 Numero 2 :
Label3 lblResultado Resultado
Propiedades
Control
Name Text Color ReadOnly
Edit1 edtN1
dtN1 Nada False
Edit2 edtN2 Nada False
Computación e Informática I Semestre
21
22. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
Edit3 edtResultado Nada cl3DLight True
Propiedades
Control
Name Caption
RadioButton1 rbtSuma Suma
RadioButton2 rbtResta Resta
RadioButton3 rbtMultiplica Multiplica
RadioButton4 rbtDivide Divide
Propiedades
Control
Cont
Name Caption Kind
BitBtn1 bbtnSalir Nada bkClose
Codificacion
rbtSuma (Click)
procedure TForm1.rbtSumaClick(Sender: TObject);
Var
nN1,nN2, Res : Integer;
begin
nN1:=StrToInt(edtN1.Text);
nN2:=StrToInt(edtN2.Text);
Res := nN1 + nN2;
N1
edtResultado.Text:=IntToStr(Res);
end;
rbtResta (Click)
procedure TForm1.rbtRestaClick(Sender: TObject);
Var
nN1,nN2, Res : Integer;
begin
nN1:=StrToInt(edtN1.Text);
nN2:=StrToInt(edtN2.Text);
Res := nN1 - nN2;
edtResultado.Text:=IntToStr(Res);
edtResultado.Tex
end;
rbtMultiplica (Click)
procedure TForm1.rbtMultiplicaClick(Sender: TObject);
Var
nN1,nN2, Res : Integer;
begin
nN1:=StrToInt(edtN1.Text);
nN2:=StrToInt(edtN2.Text);
Res := nN1 * nN2;
edtResultado.Text:=IntToStr(Res);
end;
Computación e Informática I Semestre
22
23. Instituto Superior Tecnológico Privado “Nazaret”
Carrera Profesional de Computación e Informática Computación e
Lenguaje de Programación I Informática
rbtDivide (Click)
procedure TForm1.rbtDivideClick(Sender: TObject);
Var
nN1,nN2 : Integer;
Res : Real;
begin
nN1:=StrToInt(edtN1.Text);
nN2:=StrToInt(edtN2.Text);
Res := nN1 / nN2;
edtResultado.Text:=Format('%f',[Res]);
end;
Computación e Informática I Semestre
23