# VU HELP

Virtual University of Pakistan Study forum !

# Cs101 assignment solution

<html>

<title>Weight Calculator</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 * 2.2046 ;

document.getElementById('pounds').value = num;

num = x * 1000 ;

document.getElementById('grams').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>

<body>

<div align="center" style="margin-left: 35%; margin-right: 35%;">

<div style="font-size: 36px; background-color:; color: deepskyblue;">Weight Converter</div>

<p style="font-size: 20px; background-color blueviolet; 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 Poundss:</label>

</td>

<td>

<input type="number" name="in_g" id="pounds">

</td>

</tr>

<tr>

<td>

<label>Grams:</label>

</td>

<td>

<input type="number" name="in_p" id="grams">

</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>

Views: 1357

### Replies to This Discussion

add some changes then submit

but you know vu says it not in word formate file

tu jis format main kha ha us format main bna lain ..

bhai itna to kar sakty na

ye just coding hai

usy html me khud karen save

and then submit

select all desired text copy it and paste in notepad and save as .html format at your accessible location and open it

to much simple

wasim bhai aik bat btayen code accsses hone k bad jo result hai means woh puri jo diagram hai woh send krni hai naa VU ko codes to nai naa... means jo accssesable result hai just woh send krna hai naa

yes

thanks iqra

yes of course you will send the diagram type result not the code

thanks bhai

very best very best

## Discussion Forum

### Cs101 assignment solution

Started by Iqra Mubasher.
by Muhammad Abdullah 7 hours ago.

### cs101 assingment solution 2018

Started by Muhammad Hasan.
by + caмe4ѕтυdιeѕ May 9.

### CS101 Assignment # 1 Due Date: 9th May, 2018

Started by + caмe4ѕтυdιeѕ.
by + caмe4ѕтυdιeѕ May 8.

### CS101 Final Term Paper From 17 Feb to 28 Feb 2017

Started by Cute S@mra.