Evaluacion iii
-
Upload
wacho-jibaja-olvera -
Category
Education
-
view
30 -
download
0
Transcript of Evaluacion iii
UNIANDESEVALUACIÒN PARCIAL TERCERO
Washington Jibaja Olvera24 DE junio de 2015SEPTIMO SISTEMASPROGRAMACIÒN WEB I
I.- DEFINA LA UTILIDAD DE LOS SIGUIENTES ELEMENTOS (HERRAMIENTAS) Y DE CADA UNA DE SUS PROPIEDADES:
Form
Propiedades
1. AutoSize Cambie el tamaño del formulario de acuerdo con la configuración de AutoSizeMode
2. ActiveForm Obtiene el formulario activo actual para esta aplicación.3. AutoSizeMode Obtiene o establece el modo por el que el formulario
cambia automáticamente de tamaño.4. Enabled Obtiene o establece un valor que indica si el control
puede responder a la interacción del usuario.
Label
Propiedades
1. Text: Obtiene o establece el texto asociado al control.2. DefaultCursor: Obtiene o establece el cursor predeterminado para el control.3. DefaultSize: Obtiene el tamaño predeterminado del control.
Caja de Texto
Propiedades
1. Text: obtiene o establece el texto actual en TextBox.2. Name: Obtiene o establece el nombre del control. 3. Multiline: Obtiene o establece un valor que indica si se trata de un control de
varias líneas de TextBox. 4. Alignment: permite que el texto se alinee a la izquierda, a la derecha, o que
aparezca centrado. 5. Locket: Obtiene o establece un valor que indica si se puede modificar el
TextBox en tiempo de diseño cuando la hoja está protegida. 6. Backcolor: Obtiene o establece el color de fondo del control.7. Forecolor: Obtiene o establece el color de primer plano del control. 8. Font: Obtiene o establece la fuente del texto que muestra el control.
Button
Propiedades
1. BackColor: Obtiene o establece el color de fondo del control.2. AutoSize: Obtiene o establece un valor que indica si el control cambia el tamaño
basándose en su contenido.3. BackColor: Obtiene o establece el color de fondo del control.4. Enabled: Obtiene o establece un valor que indica si el control puede responder a la
interacción del usuario.5. Font: Obtiene o establece la fuente del texto que muestra el control.6. ForeColor: Obtiene o establece el color de primer plano del control.
ListBox
Propiedades
1. BackColor: Obtiene o establece el color de fondo del control.2. AutoSize: Obtiene o establece un valor que indica si el control cambia el tamaño
basándose en su contenido.3. BorderStyle: Obtiene o establece el tipo de borde que se dibuja alrededor de ListBox.4. CanFocus: Obtiene un valor que indica si el control puede recibir el foco.5. Container: Obtiene IContainer que contiene Component.6. ContainsFocus: Obtiene un valor que indica si el control, o uno de sus controles
secundarios, tiene el foco de entrada en la actualidad.
II.-ESTABLECER EL OBJETO EN EL QUE SE DECLARAN LAS VARIABLES GENERALES QUE SE UTILIZAN EN EL EJERCICIO DE LA PRÁCTICA DEL VIDEO PRESENTADO COMO DEBER Y ÉL PORQUE.
Las declara como variables globales, porque así se pueden utilizar en cualquier parte del código.
III.- ESCRIBA LA SINTAXIS DE LA FUNCIÓN DIM Y EXPLIQUE SU APLICACIÓN A TRAVÉS DE UN EJEMPLO.
DIM Variable AS Valor de la Variable (Integer, Double, Float)
DIM Numero AS INTEGER = 3
TextBox1.Text = Numero
IV.- DESCRIBA QUE ACCIÓN REALIZAN LAS SIGUIENTES LÍNEAS DE COMANDOS:
a) Dim Total As Double: Declaración de variable total de tipo doble.
b) Dim numero As New Random: Declaración de variable número que genera números randomicos.
c) Dim n As Integer: Declaración de variable n de tipo entero.
V.- EXPLIQUE QUE FUNCIÒN REALIZA CADA UNA DE LAS LÌNEAS DE CODIGO DEL EJERCICIO PRESENTADO.
1. Private Sub Form_Load()
Text1.Text = "Un texto cualquiera"
End Sub
La caja de texto guardara o mostrara el mensaje un texto cualquiera
2. Private Sub Form_Load()
Text1.Text = Label1.Caption
End Sub
La caja de texto captura el texto que tiene la etiqueta label1
3. Private Sub Form_Load()
Label1 = "Hola"
End Sub
Le damos el texto a mostrar en la etiqueta label, pero siempre y cuando este la sintaxis de la siguiente manera. Label1.text=”Hola”
4. Private Sub Form_Load()
Picture1 = LoadPicture("la ruta de una imagen")
End Sub
Mostramos una imagen al momento de cargar el formulario
VI.- REALIZAR UN EJERCICIO EN UNA APLICACIÒN WINDOWS EN VISUAL ESTUDIO. NET QUE PERMITA INGRESAR DOS NUMEROS Y SUMARLOS, APLICAR DISEÑO EN EL FORMULARIO Y APLICAR LAS PROPIEDADES INDICADAS EN CADA UNO DE LOS OBJETOS UTILIZADOS.
Public Class Form1 Private Sub BtnCalcular_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCalcular.Click Dim val1, val2, total As Double If Textnum1.Text <> "" Or Textnum2.Text <> "" Then val1 = Textnum1.Text val2 = Textnum2.Text
total = val1 + val2 Texttotal.Text = total Else MsgBox("Llene todo los campos") End If
End Sub
Private Sub Btnlimpiar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnlimpiar.Click Textnum1.Text = "" Textnum2.Text = "" Texttotal.Text = "" End SubEnd Class
VII. ESCRIBIR LAS LINEAS DE COMANDOS QUE SE UTILIZARÌAN PARA MOSTRAR EN UN LISTBOX LOS NÙMEROS DE MANERA ASCENDENTE. EN OTRO LISTBOX DE FORMA DESCENDENTE.
Public Class Form1 Private Sub BtnAnadir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAñadir.Click If IsNumeric(TxtNumero.Text) Then LstNumero.Items.Add(TxtNumero.Text) TxtNumero.Text = "" TxtNumero.Focus() TxtNumero.SelectAll() Else MessageBox.Show("Introduzca un número entero por favor") TxtNumero.Focus() TxtNumero.SelectAll() End If End Sub Private Sub Ordenar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOrdenar.Click Dim i As Integer, j As Integer, N As Integer N = LstNumero.Items.Count 'Devuelve numero de elementos en el listbox Dim Lista(N - 1) As Integer 'Los elementos de una matriz se empiezan a referenciar en(0) If N = 0 Then MessageBox.Show("No hay números en la lista") Else 'Pasar datos del listbox a la matriz Lista For i = 0 To N - 1 Lista(i) = LstNumero.Items.Item(i) Next
End If '------------------------------------------------------------------------------ 'Ordenar de menor a mayor If OptAscendente.Checked Then Dim aux As Integer = 0 For i = 0 To N - 2 For j = i + 1 To N - 1 'Compara cada i con todo el array If Lista(i) > Lista(j) Then 'Intercambia si primero mayor aux = Lista(i) Lista(i) = Lista(j) Lista(j) = aux End If Next j Next i End If
'----------------------------------------------------------------------------------- 'Ordenar de mayor a menor If OptDescendente.Checked Then Dim aux As Integer = 0 For i = 0 To N - 2 For j = i + 1 To N - 1 'Compara cada i con todo el array If Lista(i) < Lista(j) Then 'Intercambia si primero mayor aux = Lista(i) Lista(i) = Lista(j) Lista(j) = aux End If Next j Next i
End If '----------------------------------------------------------------------------------- 'Escribir los numeros ordenados en el listbox LstNumero.Items.Clear() 'Vacía el listbox For i = 0 To N - 1 LstNumero.Items.Add(Lista(i)) Next i End SubEnd Class
VIII.- CODIFIQUE LAS LINEAS DE COMANDOS NECESARIAS PARA PODER COMPARAR TRES NÙMEROS INGRESADOS EN UNA CAJA DE TEXTO Y MOSTRAR EN EL LISTBOX EL MAYOR.
If Val(Textnum1.Text) > Val(Textnum2.Text) And Val(Textnum1.Text) > Val(Textnum3.Text) Then mayor.Items.Add(Val(Textnum1.Text)) ElseIf Val(Textnum2.Text) > Val(Textnum1.Text) And Val(Textnum2.Text) > Val(Textnum3.Text) Then mayor.Items.Add(Val(Textnum2.Text)) ElseIf Val(Textnum3.Text) > Val(Textnum1.Text) And Val(Textnum3.Text) > Val(Textnum2.Text) Then mayor.Items.Add(Val(Textnum3.Text)) End If
IX.- AL EJERCICIO ANTERIOR VIII ASIGNELE UN BOTTOM Y PROGRAME LAS LINEAS DE COMANDOS QUE PERMITAN GENERAR DE MANERA REPETITIVA EL INGRESO DE LOS NÙMEROS.
If IsNumeric(TxtNumero.Text) Then LstNumero.Items.Add(TxtNumero.Text) TxtNumero.Text = "" TxtNumero.Focus() TxtNumero.SelectAll() End If
.