Microsoft 98-382 - Introduction to Programming Using JavaScript Exam
Page: 2 / 8
Total 39 questions
Question #6 (Topic: Topic 1)
You are writing a JavaScript program for Contoso Suites that will output HTML.
You need to output each room type on a new line using the correct method.
You create the following code for the function. Line numbers are included for reference only.
[Microsoft-98-382-1.0/xmlfile-14_1.jpg]
You need to insert the correct code at Line 9. Which line should you use?
You need to output each room type on a new line using the correct method.
You create the following code for the function. Line numbers are included for reference only.
[Microsoft-98-382-1.0/xmlfile-14_1.jpg]
You need to insert the correct code at Line 9. Which line should you use?
A. document.getElementById("body").innerHTML = rooms[i] + line.innerHTML;
B. document.getElementById("para").innerHTML += rooms[i] + line.innerHTML;
C. document.getElementById("para").innerHTML += i + rooms + line.innerHTML;
D. document.getElementById("body").innerHTML += rooms + i;
Answer: B
Question #7 (Topic: Topic 1)
DRAG DROP
You are creating a web page that requests a username.
You create the following HTML form:
[Microsoft-98-382-1.0/xmlfile-15_1.png]
You 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.
Select and Place:
[Microsoft-98-382-1.0/xmlfile-15_2.jpg]
You are creating a web page that requests a username.
You create the following HTML form:
[Microsoft-98-382-1.0/xmlfile-15_1.png]
You 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.
Select and Place:
[Microsoft-98-382-1.0/xmlfile-15_2.jpg]
Answer: [Microsoft-98-382-1.0/xmlfile-16_1.jpg]
Question #8 (Topic: Topic 1)
DRAG DROP
You are using JavaScript to create a calculator.
You create the following HTML. Line numbers are included for reference only.
[Microsoft-98-382-1.0/xmlfile-16_2.jpg]
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.
Select and Place:
[Microsoft-98-382-1.0/xmlfile-17_1.jpg]
You are using JavaScript to create a calculator.
You create the following HTML. Line numbers are included for reference only.
[Microsoft-98-382-1.0/xmlfile-16_2.jpg]
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.
Select and Place:
[Microsoft-98-382-1.0/xmlfile-17_1.jpg]
Answer: [Microsoft-98-382-1.0/xmlfile-18_1.jpg]
Question #9 (Topic: Topic 1)
HOTSPOT
For each of the following segments, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:
[Microsoft-98-382-1.0/xmlfile-19_1.jpg]
For each of the following segments, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:
[Microsoft-98-382-1.0/xmlfile-19_1.jpg]
Answer: [Microsoft-98-382-1.0/xmlfile-20_1.jpg]
Question #10 (Topic: Topic 1)
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.
[Microsoft-98-382-1.0/xmlfile-21_1.png]
You create the following JavaScript code to display the warning.
[Microsoft-98-382-1.0/xmlfile-21_2.png]
When you choose spicy and click Order, the warning fails to display.
You need to solve this problem.
What should you do?
You create the following form. Line numbers are included for reference only.
[Microsoft-98-382-1.0/xmlfile-21_1.png]
You create the following JavaScript code to display the warning.
[Microsoft-98-382-1.0/xmlfile-21_2.png]
When you choose spicy and click Order, the warning fails to display.
You need to solve this problem.
What should you do?
A. Change line 07 to <button onchange = “checkWarning();â€>Order</button>
B. Change line 07 to <button onclick = “checkWarning;â€>Order</button>
C. Change line 10 to var option.value = document.forms.orderForm[“heatIndexâ€];
D. Change line 10 to var option = document.forms.orderForm[“heatIndexâ€].value;
Answer: D