Questions
In this assignment, you will use regular JavaScript and the Fetch API to read an external...

In this assignment, you will use regular JavaScript and the Fetch API to read an external JSON data file from the server and then add the data from each student object into new rows in an existing HTML table.

This assignment is very similar to the Adding Rows to a Table assignment. The main difference is that you will:

  • Use the Fetch API instead of using the AJAX API to read the external JSON data file.

Set Up This Assignment

Add this HTML to your "week11/index.html" file. Put your name in the meta author tag (highlighted below).

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Using Fetch to read a JSON file</title>
    <meta name="description" content="This is a simple example using Fetch to read a 
       JSON string then add student data as rows in an HTML table.">
    <meta name="author" content="Your name here">

    <!-- link to external CSS file -->
    <link rel="stylesheet" href="css/styles.css?v=1.0">
</head>
<body>
    <!-- Content of the page goes here. -->
    <main>
        <h1>Use Fetch to read JSON data</h1>
        <section class="intro">
            <h2>Introduction</h2>
            <p>In this assignment you will use Fetch to read in an external JSON data file. 
                You will then display the contents in a web page as new rows in an existing table. 
            </p>
        </section>

        <section class="student-info">
            <h2>Student Information from JSON file</h2>
            <p class="loading">Loading student data...</p>
            <table id="student-table">
              <thead>
                <tr><th scope="col">Name</th><th scope="col">Favorite Hobby</th><th scope="col">Favorite Color</th></tr>
              </thead>
              <tbody>
              </tbody>
            </table>
        </section>
    </main>
    
    <!-- link to external JS file -->
    <script src="js/scripts.js"></script>
</body>
</html>

JSON Data
You will also use the same students.json file that you used in the week9 assignment. Put the JSON file in a "data" subdirectory: "week11/data/students.json"

CSS Stylesheet
You will also use the same CSS file that you used in the week9 assignment. Put the CSS file in a "css" subdirectory: "week11/css/styles.css"

JavaScript
Your "week11/js/scripts.js" file will use the fetch API to read an external JSON data file, then add student data as rows to an existing table. This page contains sample code that uses the fetch API: Fetch API: An Example

This displayData function needs to do these things:

  • Create a DOM fragment.
  • Loop through the "students" object.
  • Read the first name, last name, favorite hobby, and favorite color from each object.
  • Create a table row "tr" element.
  • Create a table data "td" element for each column in the row.
  • Add the student's name to the first column of the row using createTextNode, template literals, and appendChild. The first column should contain both the student's first and last name in this format - "lastname, firstname" - then append the td to the tr element.
  • Add the student's hobby in the second column, then append it to the tr element.
  • Add the student's favorite color in the third column, then append it to the tr element.
  • Add the tr to a DOM fragment
  • Finally, after you've built your DOM fragment append it the "#student-table tbody" element.
  • Use querySelector to read the "p.loading" paragraph.
  • Change the class attribute of that paragraph from 'loading' to 'loadingHidden' using 'classList.replace': Setting CSS Styles Using JavaScript
 

In: Computer Science

Find the data for the problem in the first worksheet named LightbulbLife of the data file....

  1. Find the data for the problem in the first worksheet named LightbulbLife of the data file. It gives the data on the lifetime in hours of a sample of 100 lightbulbs. The company manufacturing these bulbs wants to know whether it can claim that its lightbulbs typically last more than 1000 burning hours. So it did a study.
    1. Identify the null and the alternate hypotheses for this study.
    2. Can this lightbulb manufacturer claim at a significance level of 5% that its lightbulbs typically last more than 1000 hours? What about at 1%? Test your hypothesis using both, the critical value approach and the p-value approach. Clearly state your conclusions.
    3. Under what situation would a Type-I error occur? What would be the consequences of a Type-I error?
    4. Under what situation would a Type-II error occur? What would be the consequences of a Type-II error?

In: Statistics and Probability

The null and alternate hypotheses are: H0 : μ1 = μ2 H1 : μ1 ≠ μ2...

The null and alternate hypotheses are:

H0 : μ1 = μ2
H1 : μ1μ2

A random sample of 9 observations from one population revealed a sample mean of 24 and a sample standard deviation of 3.7. A random sample of 6 observations from another population revealed a sample mean of 28 and a sample standard deviation of 4.6.

At the 0.01 significance level, is there a difference between the population means?

a. State the decision rule. (Negative values should be indicated by a minus sign. Round your answers to 3 decimal places.)

b. Compute the pooled estimate of the population variance. (Round your answer to 3 decimal places.)

c. Compute the test statistic. (Negative value should be indicated by a minus sign. Round your answer to 3 decimal places.)

d. State your decision about the null hypothesis.​

e.The  p-value is​

In: Math

The Big Red Company sold merchandise to a customer for 500,000 on January 1st, 2004 with...

The Big Red Company sold merchandise to a customer for 500,000 on January 1st, 2004 with a cost of 100,000. A payment of 100,000 is due at date of sale and annual payments of 100,000 due each succeeding January. The expected collectibility is exceptionally uncertain. Use the installment method of accounting and the cost recovery method to journalize the necessary entries.

In: Accounting

Apple recently had a stock split, so I decided to buy a few shares of Apple...

Apple recently had a stock split, so I decided to buy a few shares of Apple stock. As of today, Apple's beta is 1.28, the treasury yield is around 1.42%, and the market risk premium is 5.6% (Rudden, 2020). What is my expected return on Apple stock? Please explain your work.

Economic State Probability Sony McDonald's
Recession 50% 5% 6.00%
Normal 30% 7.69% 5.28%
Expansion 20% 15% 5.80%

In: Finance

Why the market tends to fail when dealing with environmental issues? It is said many externalities...

Why the market tends to fail when dealing with environmental issues? It is said many externalities in environmental economics have features that are similar to that of public goods. We know that the provision of some public goods such as lighthouse can be solved through the market rather effectively. What makes environmental goods such as clean air different from lighthouse? Why is it more difficult to solve the provision of clear air through the market? (Please state your opinion and explain why)

In: Economics

Skittles Original Fruit bite-size candies are multicolored candies in a bag, and you can "Taste the...

Skittles Original Fruit bite-size candies are multicolored candies in a bag, and you can "Taste the Rainbow" with their five colors and flavors: green, lime; purple, grape; yellow, lemon; orange, orange; and red, strawberry. Unlike some of the other multicolored candies available, Skittles claims that their five colors are equally likely. In an attempt to reject this claim, a 4-oz bag of Skittles was purchased and the colors counted. Does this sample contradict Skittle's claim at the .05 level?

Red Orange Yellow Green Purple
16 24 25 30 27

(a) Find the test statistic. (Give your answer correct to two decimal places.)


(b) Find the p-value. (Give your answer bounds exactly.)
< p <

In: Statistics and Probability

In your own words, what is consideration? Provide an example (real life or hypothetical, but not...

In your own words, what is consideration? Provide an example (real life or hypothetical, but not a published online case) of adequate consideration OR lack of consideration. Explain the circumstances surrounding your example - e.g. what did each person say, etc. Then explain how the facts you detail constitute adequate consideration or lack of consideration.

For example:

My two year-old is precariously holding his Winnie the Pooh cup (with no lid) filled with milk. He's standing on the carpet with that look in his eye (parents, you know THE LOOK) as if to say, if you don't do what I want RIGHT NOW, I'm going to dump this entire cup of milk on the carpet. I quickly say "I promise to feed you, clothe you, and pay for your boxes & boxes of diapers (since no, you aren't potty trained yet), if you please refrain from pouring your Winnie the Pooh cup of milk on the carpet."

This is an example of a lack of consideration. I have a preexisting legal duty (p.215) to feed, clothe, and pay for all of those diapers for my 2 year-old, thus, there was no legally sufficient value given. Also, although I felt like I was 'bargaining' with my 2 year-old, per the objective theory of contracts, there was no actual 'bargained-for exchange.' (This is all besides the fact that a 2 year-old cannot be a contracting party.). Consequently, there was a lack of consideration in my hypothetical & he poured the milk on the carpet anyway …

In: Psychology

discuss one of the services Windows offers. Give a quick description of the service, how to...

discuss one of the services Windows offers. Give a quick description of the service, how to configure and enable it, whether the system uses it all the time, or just when you turn it on, and what your opinion is of the service. Does it do everything it needs to do for the user? What about ease of use?

In: Computer Science

Click here to read the eBook: The Cost of Retained Earnings, rs Problem Walk-Through COST OF...

Click here to read the eBook: The Cost of Retained Earnings, rs
Problem Walk-Through

COST OF COMMON EQUITY

The future earnings, dividends, and common stock price of Callahan Technologies Inc. are expected to grow 4% per year. Callahan's common stock currently sells for $22.75 per share; its last dividend was $2.50; and it will pay a $2.60 dividend at the end of the current year.

  1. Using the DCF approach, what is its cost of common equity? Round your answer to two decimal places. Do not round your intermediate calculations.
    %

  2. If the firm's beta is 1.20, the risk-free rate is 8%, and the average return on the market is 14%, what will be the firm's cost of common equity using the CAPM approach? Round your answer to two decimal places.
    %

  3. If the firm's bonds earn a return of 8%, based on the bond-yield-plus-risk-premium approach, what will be rs? Use the midpoint of the risk premium range discussed in Section 10-5 in your calculations. Round your answer to two decimal places.
    %

  4. If you have equal confidence in the inputs used for the three approaches, what is your estimate of Callahan's cost of common equity? Round your answer to two decimal places. Do not round your intermediate calculations.
    %

In: Finance