HTML HELP NEEDED!!!!!! FREE 10 POINTS AND A...

Clarke S

New member
...COOKIE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!? I cant get my stupid program to work
i need it to display different outputs depending on the x variable
but it always displays the you're failing output =/ any ideas?

<html>
<head>
<title> Control Structures </title>
<script language="javascript">
var fullname=null;
var mark,x=null;
var nl="<BR>"
fullname = prompt("Please enter your first and last name");
mark = prompt("Please enter your score in this course - ICS3M");
alert("Welcome to my Website" + " " + fullname + "\n" + " " + "Your score is" + " " + mark);
</script>
</head>
<body>
<center>
<h1>
<script language="javascript">
document.write("Hi" + " " + fullname +nl);
document.write("Your score is" + " " + mark +nl);
if((x>=0) && (x<50))
{
document.write("You are at level zero. You FAIL" + nl);
}
else if (x===50)
{
document.write("Your score is exactly PASSING");
}
else if((x>=50) && (x<60))
{
document.write("You are at level 1" + nl);
}
else if((x>=60) && (x<70))
{
document.write("You are at level 2" + nl);
}
else if((x>=70) && (x<80))
{
document.write("You are at level 3" + nl);
}
else if((x>=80) && (x<=100))
{
document.write("You are at the maximum level which is level 4" + nl);
}
else
{
document.write("YOU ENTERED INVALID RANGE OF SCORE" + nl);
}
</script>
</body>
</html>
no, it doesnt work ben
 
sorry I don't know.......but can I have the 10 points please and a chocolate chip cookie =]
 
Try replacing

"if(x < 50 ) {
document.write("You are at level zero. You FAIL" + nl);
} else if( x==50) {
document.write("Your score is exactly PASSING");
} else(x > 50 ) {
document.write("You are at level 1");
}"

with

if(x<50)
{
document.write("You are at level zero. You FAIL" + nl);
}
else if ( x==50)
{
document.write("Your score is exactly PASSING");
}
else if (x > 50)
{
document.write("You are at level 1");
}

Does it work?

BTW, this is an(almost, besides this one line and the blank one above it and the one below this one and the one below that) exact copy of my answer to your previous question, just like this question is an exact(besides the title) copy of your previous question.
 
Try replacing

"if(x < 50 ) {
document.write("You are at level zero. You FAIL" + nl);
} else if( x==50) {
document.write("Your score is exactly PASSING");
} else(x > 50 ) {
document.write("You are at level 1");
}"

with

if(x<50)
{
document.write("You are at level zero. You FAIL" + nl);
}
else if ( x==50)
{
document.write("Your score is exactly PASSING");
}
else if (x > 50)
{
document.write("You are at level 1");
}

Does it work?

BTW, this is an(almost, besides this one line and the blank one above it and the one below this one and the one below that) exact copy of my answer to your previous question, just like this question is an exact(besides the title) copy of your previous question.
 
Back
Top