Está en la página 1de 4

TRABAJO COLABORATIVO N 2 UNIDAD 2: FUNDAMENTOS DE VISUAL BASIC.

NET

INS GARCA HERNNDEZ Cdigo: 1056994010

VISUAL BSIC AVANZADO TUTOR: JAIME RUBIANO LLORENTE GRUPO: 405021_13

UNIVERSIDAD NACIONAL ABIERTA Y A DISTANCIA UNAD FACULTAD DE CIENCIAS BSICAS E INGENIERIA AULA VIRTUAL MAYO 2013

ACTIVIDAD No. 3 En otro punto del documento se debe definir los objetos que se requieren crear especificando sus propiedades, mtodos y eventos que se afecten, adicional se debe agregar el cdigo correspondiente para la creacin delas clases derivadas del punto anterior. Public Class Estudiante 'atributos, Campos o propiedades **** estado Private Codigo As Integer Private Nombre As String Private Apellido As String Private Direccion As String Private Telefono As Integer Private Edad As Integer Private Curso As String 'mtodos constructores **** comportamiento Sub New(ByVal codigo As Integer, ByVal nombre As String, ByVal apellido As String, ByVal direccion As String, ByVal telefono As Integer, ByVal edad As Integer, ByVal curso As String) Me.Codigo = codigo Me.Nombre = nombre Me.Apellido = apellido Me.Direccion = direccion Me.Telefono = telefono Me.Edad = edad Me.Curso = curso End Sub 'mtodos **** comportamiento Function GetCodigo() As Integer Return Me.Codigo End Function Function GetNombre() As String Return Me.Nombre End Function Function GetApellido() As String Return Me.Apellido End Function Function GetDireccion() As String Return Me.Direccion End Function Function GetTelefono() As Integer Return Me.Telefono

End Function Function GetEdad() As Integer Return Me.Edad End Function Function GetCurso() As String Return Me.Curso End Function End Class --------------------------------------------------------------------------------------------------------Public Class Principal

Private Sub BtnMostrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTN_Mostrar.Click 'Instancia el Objeto Estudiante Dim Usuario As New Estudiante("12345", "Ines", "Garcia", "Uvita", "31256789", "27", "net")

'Creacin de variable para mostrar el dato Dim cod As Integer Dim nom As String Dim ape As String Dim dir As String Dim tel As Integer Dim eda As Integer Dim cur As String 'Se obtiene los datos del objeto estudiante cod = Usuario.GetCodigo() nom = Usuario.GetNombre() ape = Usuario.GetApellido() dir = Usuario.GetDireccion() tel = Usuario.GetTelefono() eda = Usuario.GetEdad() cur = Usuario.GetCurso() MessageBox.Show("El codigo del estudiante es :" & cod & " Nombre :" & nom & " Apellido :" & ape & " Direccin :" & dir & " Telefono :" & tel & " Edad :" & eda & " Curso :" & cur)

End Sub End Class

También podría gustarte