Now Playing Tracks

exercise 2.html

<html>
<head>
<title>JRU CS/IT Department </title>
<h2 align=’center’> JRU CS/IT Department  </h2>
</head>
<script language=”javascript”>

alert(“Welcome to Jose Rizal University ! “);


var n1 = prompt(“Enter Name”,”“);
name = n1;

var c1 = prompt(“Enter Course”,”“);
course = c1;

var u1= prompt(“Enter Number of Units”,”“);
unit = parseInt(u1);

if (name == “”) name = “Jose Rizal”;
if (course == “”) course = “BSIT”;
if (!unit) unit = 24;

if (course == “BSIT”) rate = 350;
else if (course == “BSCS”) rate = 300;
else rate=1000;


document.write(“<h4> Name: ” + name + ” <\/h4>”);
document.write(“<h4> Course: ” + course + ” <\/h4>”);
document.write(“<h4> Number of Unit: ” + unit + ” <\/h4>”);
document.write(“<h4> Tuition Fee: ” + tuition + ” <\/h4>”);

function join(){
    var r = confirm(“do you really want to be here ?”);
    if (r==true){
        tuition = rate * unit;
        document.write(“<center><h2> thank you ” + name + “! <\/h2><\/center>”);
        document.write(“<center><h4> your tuition fee is ” + tuition + “. <\/h4><\/center>”);
        document.write(“<center>your transaction number is 32-00<\/center>”);
    }
}

</script>

<form>
<input type=”button” value=”Join!” onclick=”join()”/>
</form>

<body bgcolor=”black” text=”yellow”>

</body>
</html>

To Tumblr, Love Pixel Union