Question: I have to make a BMI Calculator on Visual Studio for my Capstone Course. I have what I believe is the correct code, but any

I have to make a BMI Calculator on Visual Studio for my Capstone Course. I have what I believe is the correct code, but any time I run the application, it won't do the calculation. I am linking the BMI.aspx code as well as the BMI.aspx.vb code. Thanks in advance.

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/KSU Health and Healing.Master" CodeBehind="BMI.aspx.vb" Inherits="KSUBMI.BMI" %>

BMI Calculator

Please fill out this web form!

First Name:

Your Age: Must be between 1 and 100

Email Address:

Your Weight (in lbs): Cannot be empty or zero

Your Height (in inches): Cannot be empty or zero

Here are your results:

Public Class BMI Inherits System.Web.UI.Page Protected Sub ButtonCalculate_Click(sender As Object, e As EventArgs) Handles ButtonCalculate.Click Dim Weight As Double = TextWeight.Text Dim Height As Double = TextHeight.Text Dim Result As Double = (Weight * 703) / (Height * Height) LabelBMI.Text = Result

If Result < 18.5 Then LabelResults.Text = "Underweight" ElseIf Result >= 18.5 Or Result < 24.9 Then LabelResults.Text = "Normal weight" ElseIf Result >= 25 Or Result < 29.9 Then LabelResults.Text = "Overweight" ElseIf Result >= 30 Then LabelResults.Text = "Obese" End If End Sub Protected Sub ButtonClear_Click(sender As Object, e As EventArgs) Handles ButtonClear.Click TextName.Text = "" TextAge.Text = "" TextEmail.Text = "" TextWeight.Text = "" TextHeight.Text = "" LabelResults.Text = ""

TextName.Focus() End Sub

End Class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!