You are on page 1of 9

INSTITUTO INFOTEC S.A.C POWER BUILDER 10.

5
DOCENTE: Julio C. Lpez R. julio_sagitario_18@hotmail.com
POWER BUILDER
PowerBuilder es una herramienta de desarrollo de clase empresarial desarrollada por la empresa
Sybase PowerBuilder es orientada a objetos y permite el desarrollo de diferentes tipos de
aplicaciones y componentes para ejecutar arquitecturas cliente/servidor, distribuidas y Web.

Creando un nuevo Workspace(Espacio de Trabajo)
1. Primero nos dirigimos a NEW

2. Seleccionamos la opcin Workspace

INSTITUTO INFOTEC S.A.C POWER BUILDER 10.5
DOCENTE: Julio C. Lpez R. julio_sagitario_18@hotmail.com

3. Seleccionamos Ok y nos sale una ventana donde vamos a guardar nuestro proyecto

4. A continuacin volvemos a dar clic en New y seleccionamos la ficha Target y clic en
Aplication y Ok

5. Ahora nos aparece una ventana en la cual pondremos el nombre de nuestra aplicacin
y Finish

INSTITUTO INFOTEC S.A.C POWER BUILDER 10.5
DOCENTE: Julio C. Lpez R. julio_sagitario_18@hotmail.com
6. Ahora volvemos a dar clic en NEW y seleccionamos la ficha PB Pbject / Windows /yOK


7. BIEN AHORA EN LAS PROPIEDADES PONEMOS DE TITULO SUMAS Y GUARDAMOS EN
EL ICONO DEL DISQUET

8. ACONTINUACION NOS APARACE UNA VENTANA LA CUAL TAMBIEN PONDREMOS
SUMA PERO EN ESTA OPORTUNIDAD W_SUMA

INSTITUTO INFOTEC S.A.C POWER BUILDER 10.5
DOCENTE: Julio C. Lpez R. julio_sagitario_18@hotmail.com
9. AHORA YA CREADO NUESTRO ESPACIO DE TRABJO PODEMOS OBSERVAS LA
APLICACIN Y EL FORMULARIO EN EL ESPACIO DE TRABJO

LA APLICACIN PRCTICA
Y EL FORMULARIO W_SUMA
10. AHORA VAMOS A PROGRAMAR EL SIGUIENTE CODIGO EN LA APLICACIN PRACTICA
DOBLE CLIC PARA INGRESAR Y DIGITAMOS LO SIGUIENTE

Esta codificacin permitir que el formulario w_suma se ejecute correctamente OJO:
esta opcin siempre se tendr que codificar para futuras aplicaciones











INSTITUTO INFOTEC S.A.C POWER BUILDER 10.5
DOCENTE: Julio C. Lpez R. julio_sagitario_18@hotmail.com
Disear Formulario


//Primer paso: Definir las variables
Decimal Nota1, Nota2, Nota3, Puntos, Promedio
String Obs
//Segundo paso: Almacenar los valores ingresados, en variables
//Slo los valores que se necesitan para los clculos
Nota1 = Dec(Sle_2.text)
Nota2 = Dec(Sle_3.text)
Nota3 = Dec(Sle_4.text)
//Tercer paso: Realizar los clculos para obtener los resultados
Puntos = Nota1 + Nota2 + Nota3
Promedio = Puntos/3
If Promedio >= 10.5 Then
Obs = "Aprobado"
Else
Obs = "Desaprobado"
End if
//Cuarto paso: Mostrar los resultados
St_8.Text = String(Puntos,"##0.00")
St_9.Text = String(Promedio,"##0.00")
St_10.Text = Obs







INSTITUTO INFOTEC S.A.C POWER BUILDER 10.5
DOCENTE: Julio C. Lpez R. julio_sagitario_18@hotmail.com
Ejercicio N02

//Define las variables
Decimal Nota1,Nota2,Nota3,Puntos,Promedio
String Obs
//Verifica que se haya ingresado el nombre del alumno
If Trim(sle_1.text)="" then
messagebox("Imposible continuar","Ingrese el nombre del alumno")
sle_1.setfocus()
return //Deja de ejecutar las instrucciones que continuan
End if
//Almacena las notas variables
Nota1 = Dec(Sle_2.text)
Nota2 = Dec(Sle_3.text)
Nota3 = Dec(Sle_4.text)
/* Verifica que las notas ingresadas
esten entre 0 y 20 */
If Nota1 < 0 or Nota1 > 20 Then
messagebox("Imposible continuar","La nota N 01 debe estar entre 0 y 20")
sle_2.text=""
sle_2.setfocus()
return
End if
If Nota2 < 0 or Nota2 > 20 Then
messagebox("Imposible continuar","La nota N 02 debe estar entre 0 y 20")
sle_3.text=""
sle_3.setfocus()
return
End if
INSTITUTO INFOTEC S.A.C POWER BUILDER 10.5
DOCENTE: Julio C. Lpez R. julio_sagitario_18@hotmail.com
If Nota3 < 0 or Nota3 > 20 Then
messagebox("Imposible continuar","La nota N 03 debe estar entre 0 y 20")
sle_4.text=""
sle_4.setfocus()
return
End if
//Obtiene el promedio
Puntos = Nota1 + Nota2 + Nota3
Promedio = Puntos/3
If Promedio >= 10.5 Then
Obs = "Aprobado"
Else
Obs = "Desaprobado"
End if
//Muestra los resultados
St_8.Text = String(Puntos,"##0.00")
St_9.Text = String(Promedio,"##0.00")
St_10.Text = Obs

Ejercicio 3:


//Define las variables
Decimal Nota1,Nota2,Nota3,Puntos,Promedio
String Observacion,Cualidad
//Verifica que se haya ingresado el nombre del alumno
If Trim(sle_1.text)="" then
messagebox("Imposible continuar","Ingrese el nombre del alumno")
sle_1.setfocus()
return //Deja de ejecutar las instrucciones que continuan
End if
//Almacena las notas variables
INSTITUTO INFOTEC S.A.C POWER BUILDER 10.5
DOCENTE: Julio C. Lpez R. julio_sagitario_18@hotmail.com
Nota1 = Dec(Sle_2.text)
Nota2 = Dec(Sle_3.text)
Nota3 = Dec(Sle_4.text)
/* Verifica que las notas ingresadas
esten entre 0 y 20 */
If Nota1 < 0 or Nota1 > 20 Then
messagebox("Imposible continuar","La nota N 01 debe estar entre 0 y 20")
sle_2.text=""
sle_2.setfocus()
return
End if
If Nota2 < 0 or Nota2 > 20 Then
messagebox("Imposible continuar","La nota N 02 debe estar entre 0 y 20")
sle_3.text=""
sle_3.setfocus()
return
End if
If Nota3 < 0 or Nota3 > 20 Then
messagebox("Imposible continuar","La nota N 03 debe estar entre 0 y 20")
sle_4.text=""
sle_4.setfocus()
return
End if
//Obtiene el promedio
Puntos = Nota1 + Nota2 + Nota3
Promedio = Puntos/3
If Promedio >= 10.5 Then
Observacion = "Aprobado"
Else
Observacion = "Desaprobado"
End if
//Obtiene la cualidad del alumno
If Promedio>=0 And Promedio<=6.4 Then
Cualidad="Psimo"
ElseIf Promedio>=6.5 And Promedio<=10.4 Then
Cualidad="Malo"
ElseIf Promedio>=10.5 And Promedio<=14.4 Then
Cualidad="Regular"
ElseIf Promedio>=14.5 And Promedio<=16.4 Then
Cualidad="Bueno"
ElseIf Promedio>=16.5 And Promedio<=20 Then
Cualidad="Excelente"
End if
//Muestra los resultados
St_puntos.Text = String(Puntos,"##0.00")
St_promedio.Text = String(Promedio,"##0.00")
St_observacion.Text = Observacion
St_cualidad.Text = Cualidad
INSTITUTO INFOTEC S.A.C POWER BUILDER 10.5
DOCENTE: Julio C. Lpez R. julio_sagitario_18@hotmail.com
Ejercicio 4:

//Define la variables
Decimal Sueldo,BPorcentaje,BSoles,Tpagar
Integer Mes
//Almacena en variables los valores ingresados
Sueldo=Dec(Sle_2.text)
Mes=Integer(Sle_3.text)
//Calcula el Porcentaje
If Mes=3 Then
BPorcentaje=10
Elseif Mes=7 Then
BPorcentaje=25
Elseif Mes=12 Then
BPorcentaje=50
Else
BPorcentaje=0
End if
//Calcula la bonificacin en sol es
Bsoles = Sueldo * BPorcentaje / 100
//Calcula el total a pagar
Tpagar = Sueldo + BSoles
//Muestra los resultados
St_7.Text=String(BPorcentaje,"##0.00") + "%"
St_8.Text=String(BSoles,"###,##0.00")
St_9.Text=String(Tpagar,"###,##0.00")

You might also like