السلام عليكــم ورحمـة الله وبركاتــه ،،
الموضوع حول قياس الوزن أي تدخل العمر تم الجنس تم الوزن والطول
ودلك بافتراض ان العمر 20 ... الى هنا تمام التطبيق شغال (الكود مرفق)
وعند إضافة الكود التالي :
else if ((Age<= 19.9)
document.writeln ( "<tr><td>" + BMI+ "</td></tr>" );
التطبيق لا يعمل ...
والمفروض انه في حالة ان العمر اقل من 20 يكتب نتيحة
فقط BMI
حيث
BMI=(n2/(n3*n3))*(10000.00);
هل من أي مقترح لحل المشكلة بارك الله فيكم.
<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Fig. 7.4: welcome4.html -->
<!-- Printing multiple lines in a dialog box -->
<html xmlns = "http://www.w3.org/1999/xhtml">
<head><title>ASSIGMENT 2 </title>
<script type = "text/javascript">
var Age,Gender,Weight,Height,n2,n3,BMI;
Age =window.prompt(" Enter your Age:","0");
Gender = window.prompt (" Enter your Gender:"," ");
Weight = window.prompt(" Enter your Weight in Kg:","0");
Height =window.prompt(" Enter your Height in CM :","0");
n2 =parseInt(Weight);
n3 =parseInt(Height);
BMI=(n2/(n3*n3))*(10000.00);
document.writeln( "<h1>Body Mass Calculation</h1>" );
document.writeln( "<table border = \"1\" width = \"100%\">" );
if (( Age = 20 ) && ( BMI<=18.5 ))
document.writeln( "<tr><td>" + BMI + "Underweight" + Age + "</td></tr>" );
if (( Age = 20 ) && ( (BMI<=24.9 )&&(BMI >18.5) ))
document.writeln( "<tr><td>" + BMI + "Normal" + Age + "</td></tr>" );
if (( Age = 20 ) && ( (BMI<=29.5 )&&(BMI >25.0) ))
document.writeln( "<tr><td>" + BMI + "Overweight" + Age + "</td></tr>" );
if (( Age = 20 ) && (BMI>= 30))
document.writeln( "<tr><td>" + BMI + "Obese" + Age + "</td></tr>" );
// Display results
document.writeln( "</table>" );
// -->
</script>
</head>
<body>
</body>
</html>