Our Recommendation for You Search your Query, You can find easily. for example search by book name or course name or any other which is related to your education

Followers

CS101 Assignment No 2 Solution

CS101 Assignment No 2 Fall 2017

Dear Students, Here you can read or Download CS101 -Introduction to Computing Assignment No 2 Solution and Discussion of Semester Fall 2017. CS101 Assignment Solution has been added. Assignment Due Date is 12 January, 2018. Total Marks are 20. We are here to facilitate your learning and we do not appreciate the idea of copying or replicating solutions.CS101 Assignment Objectives:
After solving this assignment, students will learn about,
  • HTML tags and handling of HTML tags. 
  • Table creation and handling in HTML. 
  • Knowledge about JAVA SCRIPT functions and JAVA SCRIPTS events. 

CS101 Assignment Instructions:

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.
Please Note: All types of plagiarism are strictly prohibited.

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

CS101 Assignment Question Statement:

Please Note: Students are required to submit HTML code file only with .html extension.Don’t upload word format file(.doc) etc.

You are required to write HTML with JavaScript code to create Weight Converter Calculator web page which can be used to convert values entered in Kilo Gram to Gram, Pounds, Milligrams, US tons and Ounces respectively.

CS101 Assignment Solution Guidelines :

Solution guidelines of this web page are given as follow,
  • You are required to create a text for taking input from the users in Kilo Grams. This text box can be labeled as Weight in KG. 
  • The users will be required to enter their input in Weight in Kg. 
  • Create one button labeled as Convert. On Mouse Click event the function “Converter” should be called to covert KG value to other units. 
  • If no value or less than 0 is entered in KG text box and Covert button is clicked then alert should be shown through the window.alert() as:

CS101 Assignment Question figure (a)

  • If the values is greater than 0 then your webpage will show converted values in Grams, Pounds, Milligrams, US tons and Ounces in the given text boxes as shown in sample output. 
  • Create another button labeled as Reset Form to clear text box values. 
  • You are required to use table so that items of the webpage will be shown in the arranged form.
Formula for KG to Grams conversion is:

Kilo Grams= KG*1000

Formula for KG to Pounds conversion is:
Pounds = KG* 2.2046

Formula for KG to Milligrams conversion is:
Milligrams = KG* 1000000

Formula for KG to Pounds conversion is:
US Ton = KG* 0.0011023

Formula for KG to Pounds conversion is:
Ounce = KG* 35.274

Sample Output (Snapshot): Color Scheme may be of your choice


CS101 Assignment Question figure (b)

CS101 Assignment No 2 Solution Fall 2017

You will see the sample Solution file page preview below. and You can easily Download CS101 Assignment Solution File from the Download Button given below:

Scroll to Right witht the Bar below to read complete Code:


<html>
<head>
<title>homepage</title>
<script>
function check(){
var x;
x = document.getElementById('in_kg').value;
if (isNaN(x) || x <= 0) {
window.alert("Enter value grater than 0");
}else{
var num;
num = x * 1000 ;
document.getElementById('grams').value = num;
num = x * 2.2046 ;
document.getElementById('pounds').value = num;
num = x * 1000000 ;
document.getElementById('mg').value = num;
num = x * 0.0011023 ;
document.getElementById('Us_ton').value = num;
num = x * 35.274 ;
document.getElementById('ounce').value = num;
}
}
</script>
</head>

<body>
<div align="center" style="margin-left: 35%; margin-right: 35%;">
<div style="font-size: 36px; background-color: Yellow; color: Red;">Weight Converter</div>
<p style="font-size: 20px; background-color: gray; margin: 5px;">Welcome to the online converter</p>
</div>
<form align="center">
<table align="center">
<tr>
<td>
<label>Weight in KG:</label>
</td>
<td>
<input type="number" name="kg" id="in_kg">
<input type="button" name="submit" value="Convert" onclick="check()">
</td>
</tr>
<tr>
<td>
<label>Weight In Grams:</label>
</td>
<td>
<input type="number" name="in_g" id="grams">
</td>
</tr>
<tr>
<td>
<label>Pounds:</label>
</td>
<td>
<input type="number" name="in_p" id="pounds">
</td>
</tr>
<tr>
<td>
<label>MilliGram:</label>
</td>
<td>
<input type="number" name="in_m" id="mg">
</td>
</tr>
<tr>
<td>
<label>US Ton:</label>
</td>
<td>
<input type="number" name="in_t" id="Us_ton">
</td>
</tr>
<tr>
<td>
<label>Ounces:</label>
</td>
<td>
<input type="number" name="in_o" id="ounce">
</td>
</tr>
</table>
<div id="grams"></div>
<input type="reset" name="reset" value="Reset Form">

<p>You can press Reset Button for another conversion</p>
</form>
</body>
</html>

CS101 Assignment Solution Download Link