Wellbeing.docx
-
Upload
pooja-soorjonowa-fowdar -
Category
Documents
-
view
216 -
download
0
Transcript of Wellbeing.docx
-
8/16/2019 Wellbeing.docx
1/2
Wellbeing calculates the Body Mass Index (BMI) after prompting for input weight
and height. It outputs the BMI and whether it is underweight or overweight. A test
has been screenshot and displayed below.
-
8/16/2019 Wellbeing.docx
2/2
!M" #$%& WI! 'AA #*I+!I,-
/html0
/head0
/title0Body Mass Index/1title0
/1head0
/body0
#alculate my body mass index
/cript "anguage 2 3'avacript30
var myWeight 2 prompt(3&nter your weight (in 4g.)35 33)6
var myeight 2 prompt(3&nter your height (in m.)35 33)6
var myBMI 2 myWeight 1 (myeight 7 myeight)6
myBMI 2 myBMI.to8ixed(9)
alert(3My calculated BMI is ...3 : myBMI) 6
if (myBMI / ;
alert(3?,%&*W&I-!3) 6
@
if (myBMI 0 9=)
>
alert(3$&*W&I-!3) 6
@
if (myBMI 02;
alert(3WI!I, *A,-&3)
@
/1cript0
/1body0
/1html0