Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HELP WITH THIS PROBLEM PLEASE Open the hg_product.js file and take some time to review the variables and values stored in the file, but do

HELP WITH THIS PROBLEM PLEASE

Open the hg_product.js file and take some time to review the variables and values stored in the file, but do not make any changes to the file content.

Variables

Go to the hg_report.js file. First, you write information about the game that will be displayed in the web page. Declare a variable named gameReport. Within the gameReport variable, store the following HTML code.

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 where average is the value of the ratingsAvg variable and count is the value of ratingsCount.

JSFILE:

var itemTitle = "Dance Off VII";

var itemManufacturer = "Anasta Games";

var itemID = "10551";

var itemPrice = "$29.95";

var itemPlatform = "Nintendo, Playstation, Sony, Xbox";

var itemESRB = "Everyone";

var itemCondition = "New";

var itemRelease = "Sept. 28, 2018";

var itemSummary =

"

Challenge Yourself with Dance

\

Dance Off VII, the highly anticipated sequel in the Dance Off \

line of dance games, brings even more fun and challenges to your gaming console. \

Take advantage of your motion-control platform and 50 of the hottest dance \

tracks to challenge the world - or your best friends - to Dance Off.

\

You wanted the top stars and hit songs and we got 'em for this new release. \

But don't think we dropped your old favorites and standards. Every track from \

Dance Off VI is available and fully compatible with the new release. \

An added bonus: downloadable tracks from the top songs on the charts, so you \

can dance off to current hits.

\

Dance Off VII is the ultimate party game. The challenges are endless. \

Let the boys challenge the girls or the kids challenge the parents. Go \

international and stage your own Dance Off Olympics against friends from around \

the globe. Dancers can track their stats and standings on global leader \

boards.

";

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions