Question

In: Computer Science

Guidelines Look up one of the many sites describing the BMI, and read a bit about...

Guidelines

Look up one of the many sites describing the BMI, and read a bit about how it is used to indicate general health. Create a VB.Net program that, given a user’s height in inches and weight in pounds, will calculate and display his/her BMI. After calculating the user's BMI, indicate the user's health status.  

BMI = (weight * 703) / (height * height)

Display the user’s Height Status:

    BMI

Health Status

Below 18.5

    Underweight

18.5 -24.9

    Normal

25 - 29.9

    Overweight

30 & Above

    Obese

Input: Height and Weight.

Output: BMI (to one decimal, like 27.7) and Weight Status (a string, like “Overweight”)

After the remarks at the top of your program, add “Option Explicit On” and “Option Strict On”. The former requires you to explicitly declare each variable used and the latter requires you to explicitly convert data from one type to another, rather than rely on VB.Net to implicitly convert data.    

Solutions

Expert Solution

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new Console Application in VB is created using Visual Studio 2017 with name "BMICalculator".This application contains a module with name "Module1.vb".

Module1.vb :

Option Explicit On
Option Strict On
Module Module1
'Main method
Sub Main()
'declaring variable to store height
Dim height As Double
'declaring variable to store weight
Dim weight As Double
'variable to store BMI
Dim BMI As Double
'variable to store health status
Dim healthStatus As String = ""
'asking user to enter height
Console.Write("Enter height in inches : ")
'reading height
height = Double.Parse(Console.ReadLine())
'asking user to enter weight
Console.Write("Enter weight in pounds : ")
'reading weight
weight = Double.Parse(Console.ReadLine())
'calculate BMI
BMI = (weight * 703) / (height * height)
'checking BMI for health status
If BMI < 18.5 Then
'if BMI is less than 18.5 then
healthStatus = "Underweight"
ElseIf BMI >= 18.5 And BMI < 24.9 Then
'if BMI is greater than or equal to 18.5 and less than 24.9 then
healthStatus = "Normal"
ElseIf BMI >= 25 And BMI < 29.9 Then
'if BMI is greater than or equal to 25 and less than 29.9 then
healthStatus = "Overweight"
ElseIf BMI >= 30 Then
'if BMI is greater than or equal to 30
healthStatus = "Obese"
End If
'display BMI
Console.WriteLine("BMI is " & BMI.ToString("0.0"))
'display health status
Console.WriteLine("Weight status : " & healthStatus)
'to hold the string
Console.ReadKey()
End Sub

End Module

======================================================

Output : Run application using F5 and will get the screen as shown below

Screen 1 :Module1.vb

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.


Related Solutions

1. One way of accessing financial information about a company is to look it up at...
1. One way of accessing financial information about a company is to look it up at the company's website. Access the most recent annual report of a company of your choice from the company's website and address the following points. a. Review the company's footnotes (notes accompanying the financial statements) to discover how it applies the revenue recognition principle and when it recognizes revenue. Report what you discover. b. Based on your observation of the financial statements, what amount should...
This is one question about 14-bit strings How many 14-bit strings that have more 0’s than...
This is one question about 14-bit strings How many 14-bit strings that have more 0’s than 1’s? How many 14-bit strings that have even number of 0’s? How many 14-bit strings that have no consecutive three 0’s in a row?
How does one look up the z table
How does one look up the z table
pick one bias or look up one and provide 1. A general description of the bias...
pick one bias or look up one and provide 1. A general description of the bias 2. An example of how that bias could be applied in a personal finance context.
Look up one chemotherapuetic and answer the following questions: a) What is the name of the...
Look up one chemotherapuetic and answer the following questions: a) What is the name of the chemotherapuetic? Please include all chemical, generic, and patented names for this drug. b) What category of chemotherpuetic (alkylating, anti-metabolite, topoisomerase inhibitor, anti-microtubule or anti-tumor antibiotic) does it belong to? c) How does it kill or slow down cancer cells? d) What are the side effects, if any? e) What type(s) of cancer is this chemotherapuetic effective against?
Discussion Topic: You've learned a bit about credit cards, but many of us learn about them...
Discussion Topic: You've learned a bit about credit cards, but many of us learn about them the hard way. While sometimes people are forced into misusing credit cards due to circumstances beyond their control , sometimes the new availability of credit causes us to be less than prudent. Without divulging any personal information about anyone, share a story you've heard, know about, or researched (a search on credit card horror stories is usually very fruitful) about someone misusing credit cards...
To do our analysis, let's look at one of the giants Please read these online resources....
To do our analysis, let's look at one of the giants Please read these online resources. Walmart. Read and explore these online resources pertaining to Walmart's history and Information System usage. The History of Walmart from their website 45 Years of Wal-Mart History: A Technology Time Line Information System Processes in the Wal-Mart Company Report (Assessment) write an informal paragraph or two on why you think Walmart has become so successful. Using chapter 7, "DOES IT MATTER," read, think about...
WRITE A ONE-PAGE REVIEW OF THE DRUG SHORTAGE “CRISIS” AND CURRENT EVENTS. - Look up and...
WRITE A ONE-PAGE REVIEW OF THE DRUG SHORTAGE “CRISIS” AND CURRENT EVENTS. - Look up and understand the definition of prices. Understand how prices move to equate supply and demand in a capitalist economy. Look up and understand the definition of government price controls. - Review at least two historical experiences with price controls. (gasoline in the 70s, rent controls from WWII to date, beef controls after WWII, Russia’s price controls, Cuba’s price controls, Venezuela’s price controls, etc.) -
One of the new board members of the entity under audit is a bit confused about...
One of the new board members of the entity under audit is a bit confused about illegal acts. Explain to one of the board member why the auditor does NOT help prevent illegal acts and fraud. What is the role of the auditor with respect to illegal acts and fraud?
Look up “heat pump” on the Internet. What can you find out about the coefficient of...
Look up “heat pump” on the Internet. What can you find out about the coefficient of performance (COP)? What is the cost? Would a heat pump be a good investment in the area where you live? (Don’t guess. Work out some numbers.)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT