Programacion manual menus
Click here to load reader
-
Upload
marlon-betancourt -
Category
Education
-
view
400 -
download
4
description
Transcript of Programacion manual menus
![Page 1: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/1.jpg)
UNIVERSIDAD POLITECNICA SALESIANA
PROGRAMACION BASICA
Programa Menu
NOMBRE: Marlon Betancourt
CURSO: 262
![Page 2: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/2.jpg)
MANUAL DEL USUARIOEl siguiente manual de Usuario ha sido
diseñado para facilitar el acceso a diferentes programas relacionados a traves de una barra de Menus, los programas son los siguientes:
Dado N numeros por el Teclado determinar cuantos son pares y cuantos impares.
Dado N numeros por el teclado determinar la Suma y el Promedio
Dado N Numeros por el teclado determinar cual es el mayor.
![Page 3: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/3.jpg)
Requerimientos Previos
HarwareProcesador Core Duo o superior Memoria Ram mínimo de 500 GBMemoria suficiente para que soporte
Visual BasicSoftwareWindows Xp o superiorInstalar visual Basic
![Page 4: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/4.jpg)
ACCESO AL MENU DE PROGRAMAS
Click en el Menu: Programas
![Page 5: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/5.jpg)
Se despliegan las siguientes opciones:
Hacer click en la opción NUMEROS PARES.
Click en la opción NUMEROS PARES
![Page 6: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/6.jpg)
la codificación seria la siguiente:Private Sub Command1_Click()
Dim N, i, contp, contimp As Integer
Dim numero As Double
N = Val(Text1.Text)
i = 1
contp = 0
contimp = 0
While i <= N
numero = Val(InputBox("Ingrese el numero: ", "numero"))
If numero Mod 2 = o Then
contp = contp + 1
Else: contimp = contimp + 1
End If
i = i + 1
Wend
Label3.Caption = contp
Label5.Caption = contimp
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Label3.Caption = ""
Label5.Caption = ""
Text1.SetFocus
End Sub
Private Sub Form_Load()
End Sub
![Page 7: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/7.jpg)
Ingresamos los datos en el programa para la comprobación:
![Page 8: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/8.jpg)
Click en la opción número mayor
![Page 9: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/9.jpg)
la codificación seria la siguiente:
Private Sub Command1_Click()
'Dado N numeros por teclado, cual es el mayor
Dim N, i As Integer
Dim mayor, numero As Double
N = Val(Text1.Text)
may = 0
numero = 0
i = 1
While i <= N
numero = Val(InputBox("Ingrese el número:", "numero"))
If numero > mayor Then
mayor = numero
End If
i = i + 1
Wend
Label4.Caption = mayor
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Label4.Caption = ""
Text1.SetFocus
End Sub
![Page 10: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/10.jpg)
Ingresamos los datos en el programa para la
comprobación:
![Page 11: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/11.jpg)
Click en la opción Suma Promedio
![Page 12: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/12.jpg)
La codificación seria la siguiente:
Private Sub Command1_Click()
Dim N, i As Integer
Dim suma, numero, promedio As Double
N = Val(Text1.Text)
i = 1
suma = 0
promedio = 0
While i <= N
numero = Val(InputBox("Ingrese el número:", numero))
suma = suma + N
i = i + 1
Wend
Label4.Caption = suma
Label6.Caption = (suma / N)
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Label4.Caption = ""
Label6.Caption = ""
Text1.SetFocus
End Sub
![Page 13: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/13.jpg)
Ingresamos los datos en el programa para la
comprobación:
![Page 14: Programacion manual menus](https://reader037.fdocument.pub/reader037/viewer/2022102509/5561d50ad8b42a9d3f8b55d0/html5/thumbnails/14.jpg)