HOTSPOT
You are using JavaScript to write a safe root math utility that has the following requirements:
Given the function safeRoot(a, b):
If the radicand (a) is non-negative, return Math.pow (a, 1/b); Otherwise,
If the index (b) is divisible by 2, then return text indicating the result is imaginary. Otherwise return -Math.pow (-a, 1/b)
How should you complete the code? To answer, select the appropriate code segments in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Explanation:
References: https://www.w3schools.com/js/js_if_else.asp
You are creating a web page that allows customers to choose how hot their spice is. If they choose spicy, a warning should
be displayed.
You create the following form. Line numbers are included for reference only.
You create the following JavaScript code to display the warning.
When you choose spicy and click Order, the warning fails to display.
You need to solve this problem.
What should you do?
D
Explanation:
References: https://www.w3schools.com/jsref/coll_doc_forms.asp
HOTSPOT
You are designing a web page that contains a blue button. When the button is pressed, it should call a function that displays
the message Welcome!. When the cursor hovers over the button, the button should turn red. When the cursor leaves the
button, the button should revert back to its original color of blue.
You want to complete the markup using the appropriate HTML events.
How should you complete the markup? To answer, select the appropriate event in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Explanation:
References: https://www.w3schools.com/jsref/dom_obj_event.asp
You are creating a dynamic HTML page by using JavaScript.
Your page has an image of the sun. When the users mouse pointer moves across the image of the sun, the image should
change to the image of the moon. When the users mouse pointer is no longer over the image should change back to the
image of the sun.
You need to write the code for the image swap.
Which two events must you program for? (Choose two.)
B D
Explanation:
References: References: https://www.w3schools.com/jsref/dom_obj_event.asp
HOTSPOT
You need to evaluate the following code segment. Line numbers are included for reference only.
Use the drop-down menus to select the answer choice that answers each question based on the information presented in
the code segment.
Hot Area:

DRAG DROP
You are developing a web page that uses JavaScript. The script needs to display information to the user using a popup box.
Match each function that displays a popup box with its appropriate scenario.
To answer, drag the appropriate function from the column on the left to its appropriate scenario on the right. Each function
may be used once, more than once, or not at all.
NOTE: Each correct selection is worth one point.
Select and Place:

Explanation:
References: https://www.w3schools.com/js/js_popup.asp
DRAG DROP
Evaluate the following code. Line numbers are included for reference only.
What is the value of each variable at line 07? To answer, drag the appropriate value to the correct variable. Each value may
be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Explanation:
References: https://www.w3schools.com/js/js_arithmetic.asp
HOTSPOT
You are creating a function that does safe division.
The function has the following requirements:
The function receives two parameters for the numerator and denominator.
If the denominator is zero, the function must return false.
If the denominator is not zero, the function must return true.
You write the following code. Line numbers are included for reference only.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:

Explanation:
References: https://www.w3schools.com/js/js_comparisons.asp https://www.w3schools.com/jsref/jsref_if.asp
HOTSPOT
You are creating a calendar application. You need to ensure that the code works correctly for all months of the year.
How should you complete the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Explanation:
References: https://www.w3schools.com/js/js_break.asp https://www.w3schools.com/jsref/jsref_switch.asp
HOTSPOT
You evaluate the following code:
You need to determine the values of sampleStudent, sampleCourse.name, and sampleCourse.grade that are output by
console.log().
What are the final values for the three variables? To answer, select the appropriate values in the answer area.
Hot Area:

Explanation:
References: https://www.w3schools.com/js/js_output.asp