Question
how can I display the BMI and the weight status?
DOCTYPE html> 2 chtml> Echead> 4 6 <script type text/javascript> 7 function assessBMI ) ( var weight document.getElementById
15 switch (calcBMI) 16 17 case (calcBMI<18.5): conclusion Underveight; break; case (calcBMI > 18.5) 6 (calcBMI < 24.9): con
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Since document.write() function replaces all the previous values if it is written in global scope, only the value in the last document.write() will be displayed.

To solve this, we can write the complete output in a single function like -

document.write("Name" + name + "<br/>" + "Weight" + weight + "<br/> Height: " + height + "BMI " + calcBMI + "Weight Status " + conclusion);

OR

You can also create an element in your HTML and do -

document.getElementByID('element').innerHTML = 'your output';

Add a comment
Know the answer?
Add Answer to:
how can I display the BMI and the weight status? DOCTYPE html> 2 chtml> Echead> 4...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • BMI is used as the main indicator of weight status, yet certain individuals can have high...

    BMI is used as the main indicator of weight status, yet certain individuals can have high BMIs without being considered fat. how can this occur?

  • I have this C program that calculates an input and converts it to a BMI calculation....

    I have this C program that calculates an input and converts it to a BMI calculation. Any idea how this would look as an LC3 program? I'm taking an LC3 programming class next semester and want an idea of what this code would even translate to, just trying to get a head start. I'm more so curious on how to get user input in a LC3 program, then I can try myself and figure it out from there. int main()...

  • What range of BMI values represents a person with a healthy weight? HTML Editor B I...

    What range of BMI values represents a person with a healthy weight? HTML Editor B I VA -A- IEE 3 1 XX, O N V V 12pt - Paragraph - O words Question 18 O pts Direct calorimetry estimates a person's energy requirements by Comparing the amount of oxygen consumed with the amount of carbon dioxide expired Measuring the heat produced in a sealed chamber Comparing weight on land to underwater weight Measuring the amount of fat deposited under the...

  • 1. Your Body Mass Index (BMI) is a measure of your weight relative to your height....

    1. Your Body Mass Index (BMI) is a measure of your weight relative to your height. The formula can be found here: http://www.whathealth.com/bmi/formula.html (use the Imperial U.S. Method). Write an algorithm in pseudocode to calculate and display a person's BMI accepting as input their height in feet and inches and their weight in pounds. The output of your algorithm should be as follows: a. BMI b. A statement of whether the result is underweight, normal, overweight or obese.

  • I need Notebook++ coding! Thanks so much I will upvote! <!DOCTYPE html> <html> <body> <!-- replace...

    I need Notebook++ coding! Thanks so much I will upvote! <!DOCTYPE html> <html> <body> <!-- replace the text below with your name!-->    <!-- -->    <!-- -->    <title> Jason Kidwell</title> <script> // // Scientists measure an object’s mass in kilograms and its weight in newtons. // If you know the amount of mass of an object in kilograms, you can calculate // its weight in newtons with the following formula: // //       weight=mass×9.8 // // Write a...

  • Matlab calculatebmis write a ction calculatebrism that runs the BMI walue BMI can be calculated using...

    Matlab calculatebmis write a ction calculatebrism that runs the BMI walue BMI can be calculated using the following formal BMI Weight(16) 4.88 (height(ft)) where I has a unit of lb/ft? First test your function for scalar values of weight and height. Then, modify your function so it can calculate the should return a corresponding BMI vector (Do not use for loops to solve this problem.) value for multiple people at the same time, where we and he will now be...

  • javafx 1. Implement a BMI (Body Mass Index) server that will accept height and weight from...

    javafx 1. Implement a BMI (Body Mass Index) server that will accept height and weight from the client, calculate the BMI and return a string with the BMI and a status (l.e. normal, over weight, etc.). Build a GUI using JavaFX. You are given a working BMI class that will do the BMI calculations, etc. A single BMI client connection is sufficient. 2. Implement a JavaFX BMI client that will allow the user to enter height (in inches), weight (in...

  • read instructions carefully please matlab only Write a MATLAB function for a BMI calculator that receives the inputs for body weight (lbs)and height (ft) from the user's program, calculates th...

    read instructions carefully please matlab only Write a MATLAB function for a BMI calculator that receives the inputs for body weight (lbs)and height (ft) from the user's program, calculates the BMI using the equation below, displays the BMI category, and outputs the BMI value tothe user's program W (kg) h2 (m2) BMI Display Normal if 18.5 s BMI 25 Display Overweight if 25 s BMI <30 Display Obese if BMI 2 30 Else display underweight So you will create two...

  • How can I connect the html forms to php --> mysql database <!DOCTYPE html> <html lang="en">...

    How can I connect the html forms to php --> mysql database <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <h2> <center> Average: </h2> <h3> <center> Rate the following: </h2> <h3> <center> Rating Criteria: <br> Developing (0-5), Competent (6-10), Accomplished (10-15); </h3> <center> Judge Name: <input type="text" id="judge"> <br> <br> <center> 1. Articulate requirements and design of the project: <input type="text" id="num1"> <br> <br> 2. Plan the solution and implement the project: <input type="text" id="num2"> <br> <br> 3....

  • please help with these questions thank you! Height Weight BMI Age (years) HeightPercentile Weight Percentile Percentile...

    please help with these questions thank you! Height Weight BMI Age (years) HeightPercentile Weight Percentile Percentile cm 3.5 97 15.4 115 27 135 46 12 155 75 16 166 Questions to complete for the assignment: 1. What is your assessment of his growth pattern for the following items: a. weight/age b. height/age BMI percentile change over time c. If today's date is February 20, 2018 and his birth date is August 25, 2001, what is his age to date? Please...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT