Microsoft 98-388 - Introduction to Programming Using Java Exam
Page: 3 / 9
Total 42 questions
Question #11 (Topic: Topic 2, Work with data types, variables, and expressions)
DRAG DROP
You have the following code:
[Microsoft-98-388-1.0/xmlfile-20_1.png]
You need to create an int array named numbers initialized with num1, num2, and num3.
How should you complete the code? To answer, drag the appropriate code segment to the correct position. Each code segment 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-388-1.0/xmlfile-20_2.jpg]
You have the following code:
[Microsoft-98-388-1.0/xmlfile-20_1.png]
You need to create an int array named numbers initialized with num1, num2, and num3.
How should you complete the code? To answer, drag the appropriate code segment to the correct position. Each code segment 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-388-1.0/xmlfile-20_2.jpg]
Answer: [Microsoft-98-388-1.0/xmlfile-20_3.jpg]
Question #12 (Topic: Topic 2, Work with data types, variables, and expressions)
HOTSPOT
You are creating a method that processes invoices. The invoices are contained in an ArrayList instance. After each invoice is processed, the method must
remove the invoice from the ArrayList instance.
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:
[Microsoft-98-388-1.0/xmlfile-21_1.png]
You are creating a method that processes invoices. The invoices are contained in an ArrayList instance. After each invoice is processed, the method must
remove the invoice from the ArrayList instance.
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:
[Microsoft-98-388-1.0/xmlfile-21_1.png]
Answer: [Microsoft-98-388-1.0/xmlfile-22_1.png]
Question #13 (Topic: Topic 2, Work with data types, variables, and expressions)
HOTSPOT
You are writing a Java method.
The method accepts a two-dimensional String array and prints the content of each array element.
The size of each dimension of the array might be different.
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:
[Microsoft-98-388-1.0/xmlfile-23_1.png]
You are writing a Java method.
The method accepts a two-dimensional String array and prints the content of each array element.
The size of each dimension of the array might be different.
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:
[Microsoft-98-388-1.0/xmlfile-23_1.png]
Answer: [Microsoft-98-388-1.0/xmlfile-24_1.png]
Question #14 (Topic: Topic 2, Work with data types, variables, and expressions)
HOTSPOT
You are developing a Java program to play Tic-Tac-Toe. You define the following array to store the state of the board:
[Microsoft-98-388-1.0/xmlfile-25_1.jpg]
Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code.
NOTE: Each correct selection is worth one point.
Hot Area:
[Microsoft-98-388-1.0/xmlfile-25_2.png]
You are developing a Java program to play Tic-Tac-Toe. You define the following array to store the state of the board:
[Microsoft-98-388-1.0/xmlfile-25_1.jpg]
Use the drop-down menus to select the answer choice that answers each question based on the information presented in the code.
NOTE: Each correct selection is worth one point.
Hot Area:
[Microsoft-98-388-1.0/xmlfile-25_2.png]
Answer: [Microsoft-98-388-1.0/xmlfile-26_1.png]
Question #15 (Topic: Topic 2, Work with data types, variables, and expressions)
HOTSPOT
You are writing a Java program.
The program must meet the following requirements:
? Truncate firstName to its first five characters
? Set output to a string that contains the firstName and the number of characters in firstName
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:
[Microsoft-98-388-1.0/xmlfile-27_1.png]
You are writing a Java program.
The program must meet the following requirements:
? Truncate firstName to its first five characters
? Set output to a string that contains the firstName and the number of characters in firstName
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:
[Microsoft-98-388-1.0/xmlfile-27_1.png]
Answer: [Microsoft-98-388-1.0/xmlfile-27_2.png]