CS101 Assignment # 3 Assignment :
Semester: Fall 2014
Introduction to Computing - CS101
- Basic knowledge of HTML tags and handling of HTML tags.
- Table creation and handling in HTML.
- Basic knowledge about JAVASCRIPT.
- Knowledge about JAVASCRIPT functions and JAVASCRIPTS events.
- The assignment is submitted after due date.
- The assignment is submitted via email.
- The assignment is copied from Internet or from any other student.
- The submitted assignment does not open or file is corrupt.
- It is in some format other than .html.
Suppose you have been appointed as a web developer in Pakistan Meteorological department. At Meteorological center temperature (data) has received in the form of Fahrenheit scale. You have given the task now to develop an online application to convert temperature from Fahrenheit into Celsius and Kelvin scales.
- Create one text box for input temperature in Fahrenheit and two text boxes to show converted output in Celsius and Kelvin scales.
- Create a button “Convert” as shown in snapshot below. When the user clicks this button the input temperature should be converted into Celsius and Kelvin and displayed in their respective text boxes.
- Create a button “Clear form” which clears the entire form.
- Use table to arrange the fields on web page.
CS101 Assignment # 3 Solution no 1:
CS101 Assignment # 3 Solution no 2:
<head>
<h1 align="center" style="color:black" >Pakistan Meteorological department</h1>
<style>
/*Using CSS background*/
h1
{
background-color: blue;
color: #FFFFFF;
p
{
background-color: #00FF00;
}
you are welcome to online temperature converter.here is a simple fahrenheit temperature converter. you can enter
fahrenheit value and get converted values <br/>
into celsius and kelvin scales as per requirement</p>
<!--
function CelsiusConverter(){
document.converter.fahrenheit.value = (document.converter.celsius.value * 9 / 5) + 32
document.converter.kelvin.value = document.converter.celsius.value * 1 + 273.15
}
function FahrenheitConverter(){
document.converter.celsius.value = (document.converter.fahrenheit.value - 32) * 5 / 9
document.converter.kelvin.value=((document.converter.fahrenheit.value - 32)*5/9)+273.15
}
function KelvinConverter(){
document.converter.celsius.value = document.converter.kelvin.value - 273.15
document.converter.fahrenheit.value=((document.converter.kelvin.value - 273.15)*9/5)+32
}
//-->
</script>
</head>
<body>
<form name="converter" align="left">
<table><tr>
<td>Fahrenheit: </td>
<td colspan="2" align="right">
<input type="text" name="fahrenheit" onChange="FahrenheitConverter()">
</td><br />
</tr><tr>
<td colspan="2" align="right">
<input type="text" name="celsius" onChange="CelsiusConverter()">
</td><br />
</tr><tr>
<td colspan="2" align="right">
<input type="text" name="kelvin" onChange="KelvinConverter()"><br />
</td>
</tr><tr>
<td colspan="2" align="right">
<input type="button" value="Convert!" />
</td>
<td colspan="3" align="right">
<input type="reset" value="Reset form"><br>
</td>
</tr>
</table><BODY>
<p>To clear your form for a new conversions you can press the "Rest Form" button and all values will be erased from fields.</p></BODY>
</form>
</body>
</html>

For important helping material related to the subject ( Solved MCQs, Assignments, Short Notes, Solved Past Papers, E-Books, Recommended Books, FAQs, Help & Tutorials , Short Questions Answers & more). You must view all the featured discussion in this subject group.
Coding thek hein ap ki. thanks for Help
ReplyDeleteCan we do it without involving Java? Can this be done only using HTML?
ReplyDeleteI want the simplest answer to this