13 Jun USING YOUR TEXT EDITOR, OPEN LHOUSE2.HTM FROM THE ZIPPED FILE HEREVIEW IN A NEW WINDOW , ENTER YOUR NAME AND THE DATE IN THE HEAD SECTION, AND THEN SAVE THE FILE.
PART I – Scenario
The Lighthouse II (not affiliated with our previous assignment) is a charitable organization located in central Kentucky that matches donors with needy groups. The fundraising coordinator for The Lighthouse is Aaron Kitchen. On a Web page available only to Lighthouse staff, Aaron wants to display a list of information on recent donations, including the name and address of the donor, the amount donated, and the date of the donation. A list of donations from the last month has been downloaded from an external database and stored in a collection of arrays named firstName, lastName, street, city, state, zip, amount, and date. Aaron needs your help in displaying the data from those arrays in a Web table. He also wants a summary table that displays the total number of contributors and the total contribution amount.
Complete the following:
1. Using your text editor, open lhouse2.htm from the zipped file hereView in a new window , enter your name and the date in the head section, and then save the file.
2. The firstName, lastName, street, city, state, zip, amount, and date arrays have been created and populated for you in the list.js file.
In the head section of the document, insert a script element that points to this file. Also, note: Existing line in the starter lhouse2.htm it references lhouse.css not lhouse2.css – this needs correction.
3. Below the script element you just created, insert another script element that contains
the function amountTotal(). The purpose of the amountTotal() function is to return the sum of all of the values in the amount array. There are no parameters for this function. Add the following commands to the function:
a. Declare a variable named total, setting its initial value to 0.
b. Create a For loop that loops through all of the values in the amount array. At each iteration of the loop, add the current value of the array item to the value of the total variable.
c. After the For loop is completed, return the value of the total variable.
4. Scroll down the document and locate the div element with the ID data_list. Within the div element, add a script element that contains the following commands:
a. Write the following code to the document to create the header row for the table of contributions:
b. Create a For loop in which the counter variable starts at 0 and, while the counter is less than the length of the amount array, increase the counter in increments of 1.
c. Display every other row in the data list with a yellow background. To do this, within the For loop, insert an If condition that tests whether the counter variable is divisible evenly by 2 (Hint: Use the%modulus operator). If the counter variable is divisible by 2, write the following HTML tag:
Otherwise, write the following tag:
d. Next, within the For loop, write the HTML code
to the document, where date, amount, firstName, and lastName are the values of the date, amount, firstName, and lastName arrays for the index indicated by the current value of the For loop’s counter variable.
e. Next, within the For loop, write the HTML code
to the document, where street, city, state, and zip are the values of the street, city, state, and zip arrays for the current index value.
f. Finally, outside the For loop, write code that closes the Table with:
Date Amount First Name Last Name Address
date amount firstName lastName street
city, state zip
5. Go to the div element with the ID totals. Insert a script element that writes the HTML code
Summary
Contributors contributions
Amount $total
to the document, where contributions is the length of the amount array and total is the value returned by the amountTotal() function you created earlier.
6. Close the file, saving your changes.
7. Open lhouse2.html in your Web browser. Verify that a list of 35 contributions totaling $5175 is displayed in the table and that alternate rows of the contributor list have a yellow background.
All supporting files are in the Zip file lhouse2.zip
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.