Microsoft
98-382
Introduction to Programming Using JavaScript
QUESTION & ANSWERS
https://www.dumpsstar.com/98-382-pdf-dumps.html
Question No : 1
You are using JavaScript to create a calculator.
You create the following HTML. Line numbers are included for reference only.
You must create a function named add() that adds the values in the a and b input elements and displays the result in the result input
element.
You define the following function in JavaScript:
function add() {
You need to complete the body of the function.
Which three code segments should you use to develop the solution? To answer, move the appropriate code segments from the list of
code segments to the answer area and arrange them in the correct order.
NOTE: Each correct selection is worth one point.
2
Explanation:
References: https://www.w3schools.com/jsref/jsref_eval.asp
Question No : 2
You are creating a function named countdown. The function accepts a single parameter, start, and displays a countdown from that
number down to zero in increments of one.
How should you complete the code? To answer, select the appropriate code segments in the answer area.
3
Answer:
Explanation:
References: https://www.w3schools.com/js/js_operators.asp
4
Question No : 3
You are creating a JavaScript program for an accounting system.
You create the following code. Line numbers are included for reference only.
You evaluate the code to ensure that it follows JavaScript best practices. Which line should you change?
A. 01
B. 02
C. 03
D. 04
E. 05
Answer: C
Question No : 4
You are creating a web page that requests a username. You create the following HTML form:
5
Mou need to write a function that retrieves the username from the form
How should you complete the code? To answer, drag the appropriate code segments to
the correct locations. Each function 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.
Answer:
Explanation:
Box 1: document
Box 2: forms
Box 3: innerHTML
References: https://www.w3schools.com/jsref/coll_doc_forms.asp
Question No : 5
You work as a JavaScript developer for Adventure Works. You are writing a simple script
that performs the following actions:
✑ Declares and initializes an array
✑ Fills the array with 10 random integers
✑ Adds every other number starting with the first element
6
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.
Answer:
7
Explanation:
8
References: https://www.w3schools.com/jsref/jsref_push.asp https://www.w3schools.com/js/js_arrays.asp
https://stackoverflow.com/questions/9813573/how-to-perform-a-sum-of-an-int-array
Question No : 6
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
9
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.
Answer:
Explanation:
Box 1: prompt Box 2: alert Box 3: confirm
References: https://www.w3schools.com/js/js_popup.asp
Question No : 7
You are writing a function that calculates the remainder for integer division. The function receives two parameters, a and b, and must
return the remainder that is left over when the integer a is divided by the integer b.
You create the following code. Line numbers are for reference only.
10
You want to complete the function for lines 02 and 03.
Which two sets of code segments should you use? Each correct answer presents a complete solution. (Choose two.)
11
A. Option A
12
C. Option C D. Option D E. Option E F. Option F
Answer: E Explanation:
References: https://www.w3schools.com/js/js_arithmetic.asp
Question No : 8
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,
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.
13
Answer:
14
Explanation:
15
References: https://www.w3schools.com/js/js_if_else.asp
Question No : 9
You are designing a web page with a script that must dynamically change the content of a paragraph element to display the value
returned by the function randomQuote().
You have created the following code. Line numbers are included for reference only.
16
Which code segment should you use at line 08?
A. document.getElementById("tester").value = randomQuote();
B. document.getElementById("tester").title = randomQuote();
C. document.getElementById("tester").innerHTML = randomQuote();
D. document.getElementById("tester").script = randomQuote();
Answer: C Explanation:
References: https://www.w3schools.com/html/html_scripts.asp
Question No : 10
You analyze the following code fragment. Line numbers are included for reference only.
17
Answer:
18
https://www.dumpsstar.com/98-382-pdf-dumps.html