Our main purpose here discussion not just Solution
We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

CS101 Assignment # 3 Assignment :

Assignment No. 03
Semester: Fall 2014
Introduction to Computing - CS101

Total Marks:        20

Due Date:  13/02/2015


After solving this assignment, students will learn about,
  • 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.
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:

  • 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.

Note: All types of plagiarism are strictly prohibited.

For any query about the assignment, contact at cs101@vu.edu.pk
Question Statement:

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.


This application will be online and totally web based which should be made by using HTML and JavaScript languages. This application would contain single page.

Solution guidelines of this  web page are given as follow,

  • 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.

Formula for Fahrenheit to Celsius conversion is:

Celsius = Fahrenheit - 32 × 5/9

Formula for Fahrenheit to Kelvin conversion is:

Kelvin = (Fahrenheit - 32) × 5 / 9 + 273.15 

Note:  Students are required to submit single HTML file.

CS101 Assignment # 3 Solution no 1: 

very simple and easy code is given below read this code carefully and try to prepare your own
function Metalogical(){
alert('Enter a value..!');
document.form.text1.value = (document.form.textbox1.value -32) * 5/9;
document.form.text2.value = (document.form.textbox1.value -32) * 5 / 9 + 273.15;
<br />
<br />
<table border="1">
<th colspan="20" bgcolor="blue"><font color="yellow"> Pakistan Metalogical Department</font></th>
<tr><td colspan="20">you are welcome to online temperature converter.here is a simple fahrenheit temperature converter.<br /> you can enter
fahrenheit value and get converted valuesinto celsius and kelvin scales as per requirement</td></tr>
<form name="form">
<strong>Enter Fahrenheit :</strong></td><td><input type="text" name="textbox1" /></td></tr>
<tr><td><strong>Celsius :</strong></td><td><input type="text" name="text1"  /></td></tr>
<tr><td><strong>Celsius :</strong></td><td><input type="text" id="text2" /></td></tr>
<tr><td colspan="100"><center><input type="button" value="Convert" onclick="Metalogical()" /><input type="reset" value="Clear Form" /></center></td></tr>
<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>
see the attachment file 

CS101 Assignment # 3 Solution no 2:

<title>Temperature Conversion Page</title>
<h1 align="center" style="color:black" >Pakistan Meteorological department</h1>
/*Using CSS background*/
background-color: blue; 
color: #FFFFFF;
background-color: #00FF00;
<p style = "background-color: blue">
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>
<script language="JavaScript">
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
<form name="converter" align="left">
<td>Fahrenheit: </td>
<td colspan="2" align="right">
<input type="text" name="fahrenheit" onChange="FahrenheitConverter()">
</td><br />
<td> Celsius: </td>
<td colspan="2" align="right">
<input type="text" name="celsius" onChange="CelsiusConverter()">
</td><br />
<td>Kelvin: </td>
<td colspan="2" align="right">
<input type="text" name="kelvin" onChange="KelvinConverter()"><br /> 
<td colspan="2" align="right">
<input type="button" value="Convert!" />
<td colspan="3" align="right">
<input type="reset" value="Reset form"><br>
<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>

Virtual University of Pakistan
You Can Download Solved  Mid Term and Final Term Papers, Short Notes, Lecture Wise Questions Answers Files, Solved MCQs, Solved Quizzes , Solved Mid Term and Final Term Subjective Papers , Solved Mid Term and Final Term Objective Papers From This Discussion For Preparation Mid Term Papers of Fall 2014
For important helping material related to the subject ( Solved MCQsAssignmentsShort NotesSolved Past Papers, E-Books, Recommended Books, FAQs, Help & Tutorials , Short Questions Answers & more). You must view all the featured discussion in this subject group.

Post a Comment

  1. Coding thek hein ap ki. thanks for Help

  2. Can we do it without involving Java? Can this be done only using HTML?
    I want the simplest answer to this