elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


  Mostrar Temas
Páginas: [1]
1  Programación / Programación Visual Basic / Ayuda urgente en: 3 Octubre 2014, 17:26 pm
EJERCICIOS

I. Usaremos algunos controles nuevos.

a. Abrir VS 2010

b. Crear nuevo proyecto para Windows

c. De al proyecto un nombre apropiado.

d. En el Form1 pondrá un componente TabControl. Deberá ocupar casi

todo el formulario con él. Este se encuentra en la pestaña contenedores

del cuadro de herramientas. Veamos ahora las propiedades que

modificaremos

CONTROL PROPIEDAD VALOR

TabControl TabPages Presionar sobre los 3 puntos

TabPage1 Name tpAgregar

TabPage1 Text Agregar

TabPage1 ToolTipText Nuevo Alumno

TabPage2 Name tpNotas

TabPage2 Text Notas

TabPage2 ToolTipText Notas Alumno

En tpAgregar

Label1 Text Alumno

TextBox1 Name txtAlumno

TextBox1 MaxLength 35

Label2 Text Carrera

ComboBox1 Name cmbCarrera

ComboBox1 Items Tecnología Informática m/Redes

Label3 Text Asignatura

ComboBox2 Name cmbAsignatura

ComboBox2 Items Intro Sist Computacionales

Label4 Text Ingreso

DateTimerPicker Name dtpIngreso

DateTimerPicker Format Short

Button1 Name btnAgregar

Button1 Text Agregar

En tpNotas

Lable1 Name lblNombres

Lable1 BordeStyle FixedSingle

Label1 Text Alumno:

Lable2 Text N1:

Label3 Text N2:

Label4 Text N3

Label5 Text Promedio:

Textbox1 Name txtN1

Textbox2 Name txtN2

Textbox3 Name txtN3

Textbox4 Name txtProm

Textbox4 Enable False

TextBox1,2,3 MaxLength 3

Tecnología Informática m/Desarrollo

Algoritmo y Programación

Matemáticas I

RadioButton1 Name rdbEximido

RadioButton1 Text Eximido

RadioButton2 Name rdbExamen

RadioButton2 Text Examen

Button1 Name btnBuscar

Button1 Text Buscar

e. Agregamos un nuevo componente al proyecto. Una clase llamada

alumno. En esa clase declarará lo siguiente

Public Structure alumnos

 Dim nombres As String

 Dim asignatura As String

 Dim carrera As String

 Dim ingreso As Date

 Dim n1, n2, n3, prom As Double

 End Structure

 Public alum(5) As alumnos

f. En btnAgregar. Declare previamente la variable entera i y cree una

instancia de la clase alumno.

i = i + 1

 If i < 6 Then

 alu.alum(i).nombres = txtAlumno.Text

 alu.alum(i).carrera = cmbCarrera.SelectedItem

 alu.alum(i).asignatura = cmbAsignatura.SelectedItem

 alu.alum(i).ingreso = dtpIngreso.Text

 txtAlumno.Text = ""

 cmbCarrera.Text = ""

 cmbAsignatura.Text = ""

 txtAlumno.Focus()

 Else

 btnAgregar.Enabled = False

 End If

g. En el evento Click de btnBuscar programe. Declare previamente resp del

tipo string

resp = InputBox("Alumno: ", "Ingrese nombre del alumno")

 For i = 1 To 5

 If resp = alu.alum(i).nombres Then

 

lbnNombre.Text = lbnNombre.Text & " " & alu.alum(i).nombres

 End If

 Next

h. En el evento LostFocus de txtN1 programe

If Len(txtN1.Text) = 2 Then

txtN1.Text = Mid(txtN1.Text, 1, 1) & "," &

 Mid(txtN1.Text, 2, 1)

 Else

 txtN1.Text = Mid(txtN1.Text, 1, 1) & "," & Mid(txtN1.Text,

3, 1)

 End If

 End If

Mid(txtN3.Text, 2, 1)

Val(txtN3.Text)) / 3

 Else

Mid(txtN3.Text, 3, 1)

Val(txtN3.Text)) / 3

 End If

i. En el evento LostFocus de txtN2 programe

If Len(txtN2.Text) = 2 Then

Else

Mid(txtN2.Text, 3, 1)

j. En el evento LostFocus de txtN3 programe

Dim prom As Double

If Len(txtN3.Text) = 2 Then

 txtN3.Text = Mid(txtN3.Text, 1, 1) & "," &

 prom = (Val(txtN1.Text) + Val(txtN2.Text) +

 txtProm.Text = Format(prom, "##,##0.0")

 txtN3.Text = Mid(txtN3.Text, 1, 1) & "," &

 prom = (Val(txtN1.Text) + Val(txtN2.Text) +

 txtProm.Text = Format(prom, "##,##0.0")

k. En el evento TextChanged de txtProm programe

If Val(txtProm.Text) >= 5.5 Then

txtN2.Text = Mid(txtN2.Text, 1, 1) & "," &

Mid(txtN2.Text, 2, 1)

txtN2.Text = Mid(txtN2.Text, 1, 1) & "," &

 rdbEximido.Checked = True

 Else

 rdbExamen.Checked = True

 End If

l. l.Mejore los siguientes aspectos:

i. En la caja de texto txtAlumno no se permiten números

iii. En las cajas de texto para notas sólo se deben permitir

iv. Se debe chequear que al ingresar una nota por ejemplo 6

v. No se puede permitir el ingreso de notas bajo 1 y sobre 7

vi. Implemente, en la clase alumno, un procedimiento que

ii.Todos los datos son obligatorios. No pueden haber datos en

blanco.

números entre 0 y 9. Además del carácter “coma (,)”

se debe agregar ,0. Es decir, la nota quedaría 6,0

permita guardar las notas ingresadas para el alumno en tpNotas
2  Programación / .NET (C#, VB.NET, ASP) / ayuda con visual basic URGENTE!! en: 3 Octubre 2014, 17:25 pm
Bueno el tema es simple , me mandaron este trabajo con nota...... no entiendo como se hace:
EJERCICIOS

I. Usaremos algunos controles nuevos.

a. Abrir VS 2010

b. Crear nuevo proyecto para Windows

c. De al proyecto un nombre apropiado.

d. En el Form1 pondrá un componente TabControl. Deberá ocupar casi

todo el formulario con él. Este se encuentra en la pestaña contenedores

del cuadro de herramientas. Veamos ahora las propiedades que

modificaremos

CONTROL PROPIEDAD VALOR

TabControl TabPages Presionar sobre los 3 puntos

TabPage1 Name tpAgregar

TabPage1 Text Agregar

TabPage1 ToolTipText Nuevo Alumno

TabPage2 Name tpNotas

TabPage2 Text Notas

TabPage2 ToolTipText Notas Alumno

En tpAgregar

Label1 Text Alumno

TextBox1 Name txtAlumno

TextBox1 MaxLength 35

Label2 Text Carrera

ComboBox1 Name cmbCarrera

ComboBox1 Items Tecnología Informática m/Redes

Label3 Text Asignatura

ComboBox2 Name cmbAsignatura

ComboBox2 Items Intro Sist Computacionales

Label4 Text Ingreso

DateTimerPicker Name dtpIngreso

DateTimerPicker Format Short

Button1 Name btnAgregar

Button1 Text Agregar

En tpNotas

Lable1 Name lblNombres

Lable1 BordeStyle FixedSingle

Label1 Text Alumno:

Lable2 Text N1:

Label3 Text N2:

Label4 Text N3

Label5 Text Promedio:

Textbox1 Name txtN1

Textbox2 Name txtN2

Textbox3 Name txtN3

Textbox4 Name txtProm

Textbox4 Enable False

TextBox1,2,3 MaxLength 3

Tecnología Informática m/Desarrollo

Algoritmo y Programación

Matemáticas I

RadioButton1 Name rdbEximido

RadioButton1 Text Eximido

RadioButton2 Name rdbExamen

RadioButton2 Text Examen

Button1 Name btnBuscar

Button1 Text Buscar

e. Agregamos un nuevo componente al proyecto. Una clase llamada

alumno. En esa clase declarará lo siguiente

Public Structure alumnos

 Dim nombres As String

 Dim asignatura As String

 Dim carrera As String

 Dim ingreso As Date

 Dim n1, n2, n3, prom As Double

 End Structure

 Public alum(5) As alumnos

f. En btnAgregar. Declare previamente la variable entera i y cree una

instancia de la clase alumno.

i = i + 1

 If i < 6 Then

 alu.alum(i).nombres = txtAlumno.Text

 alu.alum(i).carrera = cmbCarrera.SelectedItem

 alu.alum(i).asignatura = cmbAsignatura.SelectedItem

 alu.alum(i).ingreso = dtpIngreso.Text

 txtAlumno.Text = ""

 cmbCarrera.Text = ""

 cmbAsignatura.Text = ""

 txtAlumno.Focus()

 Else

 btnAgregar.Enabled = False

 End If

g. En el evento Click de btnBuscar programe. Declare previamente resp del

tipo string

resp = InputBox("Alumno: ", "Ingrese nombre del alumno")

 For i = 1 To 5

 If resp = alu.alum(i).nombres Then

 

lbnNombre.Text = lbnNombre.Text & " " & alu.alum(i).nombres

 End If

 Next

h. En el evento LostFocus de txtN1 programe

If Len(txtN1.Text) = 2 Then

txtN1.Text = Mid(txtN1.Text, 1, 1) & "," &

 Mid(txtN1.Text, 2, 1)

 Else

 txtN1.Text = Mid(txtN1.Text, 1, 1) & "," & Mid(txtN1.Text,

3, 1)

 End If

 End If

Mid(txtN3.Text, 2, 1)

Val(txtN3.Text)) / 3

 Else

Mid(txtN3.Text, 3, 1)

Val(txtN3.Text)) / 3

 End If

i. En el evento LostFocus de txtN2 programe

If Len(txtN2.Text) = 2 Then

Else

Mid(txtN2.Text, 3, 1)

j. En el evento LostFocus de txtN3 programe

Dim prom As Double

If Len(txtN3.Text) = 2 Then

 txtN3.Text = Mid(txtN3.Text, 1, 1) & "," &

 prom = (Val(txtN1.Text) + Val(txtN2.Text) +

 txtProm.Text = Format(prom, "##,##0.0")

 txtN3.Text = Mid(txtN3.Text, 1, 1) & "," &

 prom = (Val(txtN1.Text) + Val(txtN2.Text) +

 txtProm.Text = Format(prom, "##,##0.0")

k. En el evento TextChanged de txtProm programe

If Val(txtProm.Text) >= 5.5 Then

txtN2.Text = Mid(txtN2.Text, 1, 1) & "," &

Mid(txtN2.Text, 2, 1)

txtN2.Text = Mid(txtN2.Text, 1, 1) & "," &

 rdbEximido.Checked = True

 Else

 rdbExamen.Checked = True

 End If

l. l.Mejore los siguientes aspectos:

i. En la caja de texto txtAlumno no se permiten números

iii. En las cajas de texto para notas sólo se deben permitir

iv. Se debe chequear que al ingresar una nota por ejemplo 6

v. No se puede permitir el ingreso de notas bajo 1 y sobre 7

vi. Implemente, en la clase alumno, un procedimiento que

ii.Todos los datos son obligatorios. No pueden haber datos en

blanco.

números entre 0 y 9. Además del carácter “coma (,)”

se debe agregar ,0. Es decir, la nota quedaría 6,0

permita guardar las notas ingresadas para el alumno en tpNotas
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines