Question: Part 1 : Create a Web Page with a Script Tag (1 point) As you did in the previous coding assignments, create a web page

Part 1 : Create a Web Page with a Script Tag (1 point)

As you did in the previous coding assignments, create a web page called __hw3.html

For instance, I would create a file called:

michael_makabali_hw3.html

and then create a simple HTML document with a single header1:

Results of the Function Calls

----- FORMAT ABOVE ----

Part 2 : Replace the Javascript Code in Web Page (4 Points)

The output of your javascript code:

, you're average score of your 2 tests is 90.

Part 2.1: Create the following variables in your script tag (1 point)

name (and assign it your name)

test_score_1 (and assign it the value of 100)

test_score_2 (and assign it the value of 80)

--------------------------------------------------------------------------------------------------

Part 2.2: Create the following function (2 point)

Function 1: compute_average

compute_average(score1, score2)

This function will calculate the average score of the two scores and return the average. In this case, the calculation is easy:

return (score1 + score2) / 2;

Function 2: print_result

This function will print the sentence above: ", you're average score of your 2 tests is 90." where you will need to substitute the name for the name being passed in and the average score with the average being passed in.

print_result(name, average)

Use the document.write to print the results.

Part 2.2: Call the functions you created (2 point)

Use the name, test_score_1, and test_score_2 to call your functions. For example:

var average = compute_average(test_score_1, test_score_2);

print_result(name, average);

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!