SlideShare a Scribd company logo
1 of 3
Índice De masa Corporal
Formulario Principal
Ahora ingresaremos un peso (KG) y talla (M) será:
Ahora mostraremos el código en visual basic:
Public Class Form1
Dim Imc As Double
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Imc = Val(Peso.Text) / (Val(Altura.Text) * Val(Altura.Text))
Label3.Text = Format(Imc, "##.##")
Label3.Visible = True
Button2.Enabled = True
Select Case Imc
Case Is < 17
Label4.Text = "Delgadez severa."
Label4.Visible = True
Case 17 To 18.49
Label4.Text = "Delgadez aceptable."
Label4.Visible = True
Case 18.5 To 24.99
Label4.Text = "Peso normal."
Label4.Visible = True
Case 25 To 29.99
Label4.Text = "Sobrepeso."
Label4.Visible = True
Case 30 To 34.99
Label4.Text = "Obeso: Tipo I."
Label4.Visible = True
Case 35 To 39.99
Label4.Text = "Obeso: Tipo II."
Label4.Visible = True
Case 40 To 60
Label4.Text = "Obeso: Tipo III."
Label4.Visible = True
End Select
End Sub
Private Sub TextBox1_KeyPress(ByVal KeyAscii As Integer)
If KeyAscii = Asc(vbCr) Then
If Val(Peso.Text) < 40 Or Val(Altura.Text) > 200 Then
MsgBox("Valor de PESO erróneo. Será corregido.")
Peso.Text = 60
End If
End If
End Sub
Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Peso.LostFocus
TextBox1_KeyPress(Asc(vbCr))
End Sub
Private Sub TextBox2_KeyPress(ByVal KeyAscii As Integer)
If KeyAscii = Asc(vbCr) Then
If Val(Altura.Text) < 1.4 Or Val(Altura.Text) > 2.1 Then
MsgBox("Valor de la TALLA errónea. Será corregida.")
Altura.Text = 1.65
End If
End If
End Sub
Private Sub TextBox2_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Altura.LostFocus
TextBox2_KeyPress(Asc(vbCr))
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Peso.Text = ""
Altura.Text = ""
Label3.Visible = False
Label4.Visible = False
Peso.Focus()
Button2.Enabled = False
End Sub
End Class

More Related Content

More from Jhon Silva Penekita

Examen resuelto de II unidad de computación
Examen resuelto de II unidad de computaciónExamen resuelto de II unidad de computación
Examen resuelto de II unidad de computaciónJhon Silva Penekita
 
Solución de valuación de tercero y cuarto de secundaria
Solución de valuación de tercero y cuarto de secundariaSolución de valuación de tercero y cuarto de secundaria
Solución de valuación de tercero y cuarto de secundariaJhon Silva Penekita
 
Examen mensual de computación de primer grado de secundaria
Examen mensual de computación de primer grado de secundariaExamen mensual de computación de primer grado de secundaria
Examen mensual de computación de primer grado de secundariaJhon Silva Penekita
 
Evaluación de tercero y cuarto de secundaria
Evaluación de tercero y cuarto de secundariaEvaluación de tercero y cuarto de secundaria
Evaluación de tercero y cuarto de secundariaJhon Silva Penekita
 
Creación de carpeta en windows 7 para tercero y cuarto de secundaria
Creación de carpeta en windows 7 para tercero y cuarto de secundariaCreación de carpeta en windows 7 para tercero y cuarto de secundaria
Creación de carpeta en windows 7 para tercero y cuarto de secundariaJhon Silva Penekita
 
Creación de carpeta en windows 7 para tercero y cuarto de secundaria
Creación de carpeta en windows 7 para tercero y cuarto de secundariaCreación de carpeta en windows 7 para tercero y cuarto de secundaria
Creación de carpeta en windows 7 para tercero y cuarto de secundariaJhon Silva Penekita
 
Clase 4 para primero y segundo de secundaria.
Clase 4 para primero y segundo de secundaria.Clase 4 para primero y segundo de secundaria.
Clase 4 para primero y segundo de secundaria.Jhon Silva Penekita
 

More from Jhon Silva Penekita (20)

Criterio de búsqueda
Criterio de búsquedaCriterio de búsqueda
Criterio de búsqueda
 
Examen resuelto de II unidad de computación
Examen resuelto de II unidad de computaciónExamen resuelto de II unidad de computación
Examen resuelto de II unidad de computación
 
Solución de valuación de tercero y cuarto de secundaria
Solución de valuación de tercero y cuarto de secundariaSolución de valuación de tercero y cuarto de secundaria
Solución de valuación de tercero y cuarto de secundaria
 
Examen mensual de computación de primer grado de secundaria
Examen mensual de computación de primer grado de secundariaExamen mensual de computación de primer grado de secundaria
Examen mensual de computación de primer grado de secundaria
 
Evaluación de tercero y cuarto de secundaria
Evaluación de tercero y cuarto de secundariaEvaluación de tercero y cuarto de secundaria
Evaluación de tercero y cuarto de secundaria
 
Creación de carpeta en windows 7 para tercero y cuarto de secundaria
Creación de carpeta en windows 7 para tercero y cuarto de secundariaCreación de carpeta en windows 7 para tercero y cuarto de secundaria
Creación de carpeta en windows 7 para tercero y cuarto de secundaria
 
Creacion de carpeta
Creacion de carpetaCreacion de carpeta
Creacion de carpeta
 
Creación de carpeta en windows 7 para tercero y cuarto de secundaria
Creación de carpeta en windows 7 para tercero y cuarto de secundariaCreación de carpeta en windows 7 para tercero y cuarto de secundaria
Creación de carpeta en windows 7 para tercero y cuarto de secundaria
 
Clase 4 para primero y segundo de secundaria.
Clase 4 para primero y segundo de secundaria.Clase 4 para primero y segundo de secundaria.
Clase 4 para primero y segundo de secundaria.
 
Introducción
IntroducciónIntroducción
Introducción
 
Marcell
MarcellMarcell
Marcell
 
Edad media
Edad mediaEdad media
Edad media
 
Cmd o dos
Cmd o dosCmd o dos
Cmd o dos
 
Semana 1
Semana 1Semana 1
Semana 1
 
Evaluación
EvaluaciónEvaluación
Evaluación
 
clase 3
clase 3clase 3
clase 3
 
clase 1 y dos
clase 1 y dosclase 1 y dos
clase 1 y dos
 
Jacinto
JacintoJacinto
Jacinto
 
clases de computacion teoría
clases de computacion teoríaclases de computacion teoría
clases de computacion teoría
 
La adolescencia
La   adolescenciaLa   adolescencia
La adolescencia
 

Recently uploaded

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

índice De masa corporal

  • 1. Índice De masa Corporal Formulario Principal Ahora ingresaremos un peso (KG) y talla (M) será:
  • 2. Ahora mostraremos el código en visual basic: Public Class Form1 Dim Imc As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Imc = Val(Peso.Text) / (Val(Altura.Text) * Val(Altura.Text)) Label3.Text = Format(Imc, "##.##") Label3.Visible = True Button2.Enabled = True Select Case Imc Case Is < 17 Label4.Text = "Delgadez severa." Label4.Visible = True Case 17 To 18.49 Label4.Text = "Delgadez aceptable." Label4.Visible = True Case 18.5 To 24.99 Label4.Text = "Peso normal." Label4.Visible = True Case 25 To 29.99 Label4.Text = "Sobrepeso." Label4.Visible = True Case 30 To 34.99 Label4.Text = "Obeso: Tipo I." Label4.Visible = True Case 35 To 39.99 Label4.Text = "Obeso: Tipo II." Label4.Visible = True Case 40 To 60 Label4.Text = "Obeso: Tipo III." Label4.Visible = True End Select End Sub Private Sub TextBox1_KeyPress(ByVal KeyAscii As Integer) If KeyAscii = Asc(vbCr) Then If Val(Peso.Text) < 40 Or Val(Altura.Text) > 200 Then MsgBox("Valor de PESO erróneo. Será corregido.") Peso.Text = 60 End If End If End Sub Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Peso.LostFocus TextBox1_KeyPress(Asc(vbCr)) End Sub
  • 3. Private Sub TextBox2_KeyPress(ByVal KeyAscii As Integer) If KeyAscii = Asc(vbCr) Then If Val(Altura.Text) < 1.4 Or Val(Altura.Text) > 2.1 Then MsgBox("Valor de la TALLA errónea. Será corregida.") Altura.Text = 1.65 End If End If End Sub Private Sub TextBox2_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Altura.LostFocus TextBox2_KeyPress(Asc(vbCr)) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Peso.Text = "" Altura.Text = "" Label3.Visible = False Label4.Visible = False Peso.Focus() Button2.Enabled = False End Sub End Class