DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Results 1 to 2 of 2

Thread: Need help from someone more experienced than me....

  1. Master Droid
    droidxd00d's Avatar
    Member #
    228229
    Join Date
    Oct 2011
    Posts
    250
    Liked
    23 times
    Phone
    Droid Bionic
    #1

    Need help from someone more experienced than me....

    Hey guys I have a problem from school. It is a html/javascript homework that I have been struggling with since I am still pretty new at this. I'm not asking for anyone to do the whole project for me I just would appreciate any advice, tips, or bits of code!

    Hey guys I have a problem from school

    "For this assignment, your task is to modify Assignment #1 to fix your errors, use loops, use functions, use an external style sheet and add images to your page.

    In order to fill the array that stores the “Percentage of the semester completed” information, you will call a function. This function will use a loop to fill the array.

    In order to write the table onto the Web page, you will call a function that will use a loop to create and fill the table. Each of the values of column 3 should be calculated by calling another function.

    You will create an external style sheet, which will add formatting to your page. At a minimum, your style sheet should include code to change the background color of the page and change the color of the font used for the text defined by the table heading and table data tags.

    Finally, you will add an appropriate image to your page. This image should change to another image at periodic intervals (similar to the image in the Pine Knoll Properties page that we created in class)."

    I got most of it but I can't figure out a solution for stepping through the two arrays I have and then writing them to the table. Any help would be appreciated! Oh also how do I center align the table?

    now for the mess of code...

    {code}
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <title>Tuition Refund Document</title>
    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
    <link rel="stylesheet" href="refund_styles.css" type="text/css" />

    </head>
    <body onload="var changeImages=setInterval('homepageAd()',2000);">
    <h1>Refund of Tuition and Fees for Students Who Drop or Withdrawal from Classes</h1>
    <h2>A single three credit class costs <font face="Arial" color="red">$804</font><p align="center"><img src="calU.jpg" height="100" width ="400" /></h2>
    <script type="text/javascript">

    var classCost=804;

    var semesterPercentage = new Array();
    semesterPercentage[0] = "Through Week 1";
    semesterPercentage[1] = "Through Week 2";
    semesterPercentage[2] = "Through Week 3";
    semesterPercentage[3] = "Through Week 4";
    semesterPercentage[4] = "Through Week 5";
    semesterPercentage[5] = "Through End of Semester";

    var refundPercentage = new Array();
    refundPercentage[0] = 1;
    refundPercentage[1] = .8;
    refundPercentage[2] = .6;
    refundPercentage[3] = .5;
    refundPercentage[4] = .4;
    refundPercentage[5] = 0;



    var curImage = "calU";
    var changeImages;
    function homepageAd() {
    if (curImage == "money1") {
    document.images[0].src = "calU.jpg";
    curImage == "calU";
    }
    else {
    document.images[0].src = "money1.jpg";
    curImage = "money1";
    }
    }


    function fillArray() {





    function calculateRow(currentRow)
    {
    var i = currentRow;
    var rowValue = (refundPercentage[i+1] * classCost);
    return rowValue;
    }

    function displayRow()
    {
    document.write(calculateRow() + "is the price" );

    }








    do
    {
    document.write("<tr><td>" + semesterPercentage[increment] + "</tr><td>%" + calculatePercent(increment) +
    "</tr><td>$ " + calculateRow(increment) + "</tr>");
    increment++
    }
    while (increment < 6 )
    }


    document.write("<table border='1' width='50%'><colgroup span='3' width='30%' /><colgroup span='5' width='14%' /><tr><th>Percentage of the Semester Completed</th> <th>Refund Percentage</th><th>Amount of Refund Per 3 Credit Class</th></tr>");




    </script>
    </body>
    </html>


    {code}

    the table is supposed to look like thisMarcus Angelo Assignment #1.zip
    Sent with the Ruler of All Machines! My Droid Bionic now featuring Ice Cream!
  2. Droid Jedi
    lloydstrans's Avatar
    Member #
    236023
    Join Date
    Nov 2011
    Posts
    9,502
    Liked
    269 times
    Phone
    droid MAXX
    #2
    Not too much luck with your request, sorry. I tried to learn this stuff years ago and figured someone else would create a better way, so i gave up.

    Good luck.

Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. New, yet experienced
    By EGEM_MAG_COM in forum New Member Introductions & Site Assistance
    Replies: 6
    Last Post: 03-03-2012, 09:59 AM
  2. I didn't believe it until I experienced it myself.
    By chef in forum Motorola Droid Bionic
    Replies: 20
    Last Post: 08-02-2011, 08:21 PM
  3. Experienced 4g today..
    By ToastnBananas in forum HTC ThunderBolt
    Replies: 18
    Last Post: 06-04-2011, 08:48 PM
  4. New but experienced.
    By Wonder in forum New Member Introductions & Site Assistance
    Replies: 4
    Last Post: 04-15-2011, 06:51 AM
  5. has anyone experienced this?
    By miltk in forum Android General Discussions
    Replies: 5
    Last Post: 05-24-2010, 09:27 AM

Search tags for this page

pineknollproperties

,

pineknollproperties javascript

Click on a term to search our site for related topics.
Find us on Google+