Upload
max-friel
View
7.946
Download
0
Embed Size (px)
Citation preview
Refresher lesson- Wordsearch
What do the following codes do?<html>
<body>
<script type="text/javascript">
var marks = prompt("enter the marks of test","");
marks=parseInt(marks);
if(marks>=60)
{
document.write("grade is a");
}
else if (marks >=45)
{
document.write("grade is b");
}
else
{
document.write("grade is f");
}
</script>
</body>
</html>
<html>
<body>
<script type="text/javascript">
var yr = prompt("enter the year","");
yr=parseInt(yr);
if (yr%4==0 && yr%100!=0 || yr%400==0)
{
document.write ("YEAR",yr,"is a leap year");
}
else
{
document.write ("YEAR", yr," is not a leap year");
}
</script>
</body>
</html>
What do the following codes do?
Make the following code work<html>
<body>
<script type="text/j">
var maxmarks = prompt("enter the max marks of test","");
var marks = prompt("enter the marks of test","");
maxmarks=p(maxmarks);
marks=parseInt(marks);
var percen=marks/maxmarks*100
if(percen>80)
{
document.write("you have",percen,"% in this test");
document.write("<PRE>\nCongratulations for your performance </PRE>");
}
else
{
document.write ( you need to work a little more for excellence");
document.write ("<PRE>\nPlan better and you will be there</PRE>");
}
</script>
</body>
</html>