Question: Declare a variable named gameReport . Within the gameReport variable, store the following HTML code. title By: manufacturer Product ID id List Price price Platform

Declare a variable named gameReport. Within the gameReport variable, store the following HTML code.

title

By: manufacturer

Product ID id
List Price price
Platform platform
ESRB Rating esrb
Condition condition
Release release
summary

where title , manufacturer , id , price , platform , esrb , condition , release and summary use the values from corresponding variables in the hg_product.js file.

Game Report

Display the value of the gameReport variable in the inner HTML of the first (and only) article element in the document.

(Hint : Use the getElementsByTagName() method, referencing the first item in the array of article elements.)

Ratings

Next, you write the information from the customer ratings. Start by calculating the average customer rating of the game. Declare a variable named ratingsSum setting its initial value to 0.

Declare a variable named ratingsCount equal to the length of the ratings array.

Create a for loop to loop through the contents of the ratings array. Each time through the loop, add the value of current ratings value to the value of the ratingsSum variable.

After the for loop, declare the ratingsAvg variable, setting its value equal to the value of the ratingsSum variable divided by the value of ratingsCount.

Declare a variable named ratingReport. Set its initial value to the text string

Customer Reviews

average out of 5 stars ( count reviews)

where average is the value of the ratingsAvg variable and count is the value of ratingsCount.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!