Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Recommended Textbook for

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions