Sponsored Links


Results 1 to 5 of 5

Thread: CS101 Assignment#4( help required plz)

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    2

    Icon51 CS101 Assignment#4( help required plz)

    Sponsored Links1



  2. #2
    Administrator Vuhelper's Avatar
    Join Date
    Apr 2011
    Posts
    9,578
    Code:
    <html>
    <head>
    <script type="text/javascript">
    function multi() {
    var par_elem = document.getElementById("table");
    while(par_elem.childNodes.length) {
    par_elem.removeChild(par_elem.childNodes[0]);
    }
    var input = 0.5;
    while(input < 1 || input > 12 || parseInt(input) != input) {
    if(input_str === null) {
    create_button();
    return;
    }
    var error = (typeof(input_str) != "undefined") ? "Your input is not a value between 1 and 12 or is not an integer. Try again.\n" : "";
    var input_str = window.prompt(error + "Enter a value between 1 and 12 (inclusive, integer only)", "");
    var input = new Number(input_str);
    }
    var table = document.createElement("table");
    table.style.border = "1px solid #000000";
    table.style.borderCollapse = "collapse";
    var hrow = document.createElement("tr");
    var heading = document.createElement("td");
    heading.colSpan = 5;
    heading.style.backgroundColor = "#C0C0C0";
    heading.appendChild(document.createTextNode("multiplication table for: " + input));
    hrow.appendChild(heading);
    table.appendChild(hrow);
    for(var i = 1; i < 13; i++) {
    var color = (i / 2 == Math.floor(i / 2)) ? "#E0E0FF" : "#F0F000";
    var tr = document.createElement("tr");
    var value = document.createElement("td");
    value.style.backgroundColor = color;
    value.appendChild(document.createTextNode(i));
    var times = document.createElement("td");
    times.style.backgroundColor = color;
    times.appendChild(document.createTextNode("times"));
    var inp_cell = document.createElement("td");
    inp_cell.style.backgroundColor = color;
    inp_cell.appendChild(document.createTextNode(input));
    var equals = document.createElement("td");
    equals.style.backgroundColor = color;
    equals.appendChild(document.createTextNode("equals"));
    var result = document.createElement("td");
    result.style.backgroundColor = color;
    result.appendChild(document.createTextNode(i * input));
    tr.appendChild(value);
    tr.appendChild(times);
    tr.appendChild(inp_cell);
    tr.appendChild(equals);
    tr.appendChild(result);
    table.appendChild(tr);
    }
    par_elem.appendChild(table);
    if(document.all && !window.opera) par_elem.innerHTML = par_elem.innerHTML;
    create_button();
    }
    function create_button() {
    var ie = (document.all && !window.opera);
    if(ie) var button = document.createElement("<input type='button' value='new multiplication table'>");
    else {
    var button = document.createElement("input");
    button.type = "button";
    button.value = "new multiplication table";
    }
    button.onclick = multi;
    document.getElementById("table").appendChild(button);
    }
    window.onload = multi;
    </script>
    </head>
    <body>
    <div id="table"></div>
    </body>

  3. #3
    Junior Member
    Join Date
    Dec 2011
    Posts
    7
    plz send me 4 assingment of cs201.

  4. #4
    Administrator
    Join Date
    Oct 2011
    Posts
    468
    you can check the code of html provided by vuhelper

    Sponsored Links
    03009520262
    Rabeel Website

  5. #5
    Junior Member
    Join Date
    Dec 2011
    Posts
    7
    but sir i need solution of cs201 assignment no 4 plz help me

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. CS101 Assignment No.1 Assignment and Solution Last Date 21 Nov 2014
    By Vuhelper in forum Assignments & Solutions
    Replies: 1
    Last Post: 11-17-2014, 03:21 PM
  2. Replies: 0
    Last Post: 07-16-2012, 05:26 PM
  3. Required Soluction for 3rd Assignment of CS101
    By bc120200426 in forum Get Solution In 24 Hour
    Replies: 1
    Last Post: 06-14-2012, 04:13 PM
  4. CS101 Assignment#4( help required plz)
    By hasnatahmed in forum Mcs
    Replies: 0
    Last Post: 01-13-2012, 01:55 AM
  5. cs502 assignment solution required assignment no 1
    By mc100200446 in forum Get Solution In 24 Hour
    Replies: 0
    Last Post: 11-01-2011, 02:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft