Skip to content

Cs101assignment

<html>

 <head>

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

 </head>

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

(Last Updated On: November 5, 2017)

CS101 Assignment 1 Complete Solution 2017

 

 

CS101 Assignment No 01 Solution & Discussion Fall 2017

Question No.1 
Convert (10101000)2 into decimal equivalent. You have to show all conversion steps.

Question No.2 

You are required to solve the given Boolean Expression by filling the following truth table.

 

((AB) / + A/ +(B Å C/))

ABCAB(AB)/A/C/(B Å C/)A/ +(B Å C/)((AB) / + A/ +(B Å C/))
000
001
010
011
100
101
110
111

 

You can download the CS101 Introduction to Computing Assignment 1 Solution file from here

 

Download Assignment

Related

Category: Assignments