Presentation is loading. Please wait.

Presentation is loading. Please wait.

Take out a piece of paper and PEN.

Similar presentations


Presentation on theme: "Take out a piece of paper and PEN."— Presentation transcript:

1 Take out a piece of paper and PEN.
Exposure Java 2015 for Teaching AP® Computer Science DYRT Quiz Key Take out a piece of paper and PEN. The quiz starts TWO minutes after the tardy bell rings. You will have 30 seconds per question.

2 Title the quiz as shown below The quiz starts in ONE minute.
Name Period Date Quiz 1. 12. 2. 13. 3. 14. 4. 15. 5. 16. 6. 17. 7. 18. 8. 19. 9. 20. 11. EC.

3 Question 01 A data structure is any data type that stores
one value only. more than one value. simple data types only. object values only.

4 Question 02 Which is the first historical data structure? array record
file

5 Question 03 The language FORTRAN introduced the array record file

6 Question 04 The language COBOL introduced the array record list file

7 Question 05 The keyword length indicates
the number of elements in an array. the largest index in an array. the largest array value. the memory size of each array element.

8 Question 06 The record is a data structure that stores
data types of the same value. simple data types only. objects only. elements of the same or different data types.

9 Question 07 The file is a data structure that
stores data types of the same value. handles storing data to an external file name. objects only. elements of the same or different data types.

10 Question 08 The stack is a data structure that accesses data randomly.
like a FIFO. like a LIFO. externally only.

11 Question 09 In the improved data structure definition what
characterizes a data structure? The amount of data stored The type of data stored The storing and retrieval of data The storing order of the data

12 Question 10 The enhanced “for..each” loop
is the original loop structure. is a newer loop structure. replaces the older for loop. accesses specific array elements.

13 Question 11 What data type is the array index? int double char
any simple data type

14 Question 12 What is the index value of the first array element? a 1
Any specified integer value

15 Question 13 The following array declaration: int list[ ];
list = new int[10]; is the same as which declaration? int list[ ] = new list[10]; int list[ ] = new int[10]; New int = list[10]; All of the above

16 Question 14 int list[] = {100,200,300,400,500,600,700,800};
What is the output of this program segment? int list[] = {100,200,300,400,500,600,700,800}; System.out.println(list[1]); 100 200 700 800 Error

17 Question 15 int list[] = {100,200,300,400,500,600,700,800};
What is the output of this program segment? int list[] = {100,200,300,400,500,600,700,800}; System.out.println(list[0]); 100 200 700 800 Error

18 Question 16 int list[] = {100,200,300,400,500,600,700,800};
What is the output of this program segment? int list[] = {100,200,300,400,500,600,700,800}; System.out.println(list[7]); 100 200 700 800 Error

19 Question 17 int list[] = {100,200,300,400,500,600,700,800};
What is the output of this program segment? int list[] = {100,200,300,400,500,600,700,800}; System.out.println(list[8]); 100 200 700 800 Error

20 Question 18 What is the output of this program segment?
1 2 3 4 5 6 7 8 9 Question 18 What is the output of this program segment? int list[] = new int[10]; for (int index = 0; index < list.length; index++) list[index] = index; System.out.print(list[index] + " "); (A)

21 Question 19 What is the output of this program segment?
1 2 3 4 5 6 7 8 9 10 Question 19 What is the output of this program segment? int list[] = new int[10]; for (int index = 0; index < 10; index++) list[index] = index + 1; for (int index = 1; index <= 8; index++) System.out.print(list[index] + " "); (A)

22 Question 20 Which of the following is a correct statement to
display all the values of the following array? int list[ ] = {1,2,3,4,5,6,7,8,9}; for (int k = 1; k <= 9; k++) System.out.println(list[k]); for (int k = 1; k < 9; k++) System.out.println(list[k]); for (int number : list) System.out.println(number); for (int k = 0; k <= 9; k++) System.out.println(list(k));

23 Question 21 What type of values are stored in list by the
following program segment? Random rand = new Random(); int list[ ] = new int[20]; for (int k = 0; k < 20; k++) list[k] = rand.nextInt(1000); A set of integers in the [1..20] range A set of integers in the [0..19] range (C) A set of integers in the [0..999] range (D) A set of integers in the [ ] range

24 Extra Credit What is the output of this program segment?
int numbers[ ] = {10,11,12,13,14,15,16,17,18,19,20}; Random rand = new Random( ); int index = rand.nextInt(7); System.out.println(numbers[index]); (A) An integer in the [0..6] range (B) An integer in the [10..20] range (C) An integer in the [0..10] range  (D) An integer in the [10..16] range (E) An integer in the [10..15] range


Download ppt "Take out a piece of paper and PEN."

Similar presentations


Ads by Google