You are on page 1of 3

Assignment No.

03 (Graded)
SEMESTER Spring 2017
CS101- Introduction to Computing
Note: Just Change Red Text and submit

<html>

<head>

<title>Student Id:BS123456789</title>
<script type="text/javascript">

function vuallmaterial()

var abc=dullstudent.bestchoice.value;

if(abc=="pakistan")

document.getElementById("steno").innerHTML="You Selected: Farhrenheit to Celsius";

var vulahore=dullstudent.txt.value;

var tf=(vulahore);
var tc=(5/9)*(tf-32);

var result=Math.floor((tc*Math.pow(10,2))/Math.pow(10,2));

dullstudent.txt1.value=result+" ";

else

document.getElementById("steno").innerHTML="You selected:Celcius to Fahrenheit";

var vulahore=dullstudent.txt.value;

var tc=(vulahore);

var tf=((9/5)*tc)+32;

var result1=Math.floor((tf*Math.pow(10,2))/Math.pow(10,2));

dullstudent.txt1.value=result1+" ";

} }

</script>

</head>

<body>

<h3> Convert Temperature</h3>

<form name="dullstudent">

<table>

<tr><td>Enter a value</td>

<td><input type=text name="txt"></td>

<td>

<select name="bestchoice" onchange="vuallmaterial()">

<option name="Faren" value="pakistan"> Fahrenheit(F)</option>


<option name="Cels" value="Celsius"> Celsius (C)</option>

</select>

</td>

<tr>

<td> Answer</td>

<td><input type=text name="txt1"></td>

</tr>

<tr>

<td></td>

<td colspan="2">

<p id="steno"></p>

</td>

</tr>

</tr>

</tr>

</table>

</form>

</body>

</html>

You might also like