preap computer science quiz 11.03- 05 take out a piece of paper and pen. the quiz starts one minute...

Click here to load reader

Upload: ralf-webb

Post on 19-Jan-2018

214 views

Category:

Documents


0 download

DESCRIPTION

Question 01 What data type is the array index? (a)int (b)double (c)char (d)any simple data type

TRANSCRIPT

PreAP Computer Science Quiz Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 60 seconds per question. Title the quiz as shown below The quiz starts in ONE minute. Name Period Date Quiz EC. Question 01 What data type is the array index? (a)int (b)double (c)char (d)any simple data type Question 02 What is the index value of the first array element? (a)a (b)1 (c)0 (d)Any specified integer value Question 03 The following array declaration: int list[ ]; list = new int[10]; is the same as which declaration? (a)int list[ ] = new list[10]; (b)int list[ ] = new int[10]; (c)New int = list[10]; (d)All of the above Question 04 What is the output of this program segment? int list[] = {100,200,300,400,500,600,700,800}; System.out.println(list[1]); (a)100 (b)200 (c)700 (d)800 (e)Error Question 05 What is the output of this program segment? int list[] = {100,200,300,400,500,600,700,800}; System.out.println(list[0]); (a)100 (b)200 (c)700 (d)800 (e)Error Question 06 What is the output of this program segment? int list[] = {100,200,300,400,500,600,700,800}; System.out.println(list[7]); (a)100 (b)200 (c)700 (d)800 (e)Error Question 07 What is the output of this program segment? int list[] = {100,200,300,400,500,600,700,800}; System.out.println(list[8]); (a)100 (b)200 (c)700 (d)800 (e)Error Question 08 What is the output of this program segment? int list[] = new int[10]; for (int index = 0; index < list.length; index++) list[index] = index; for (int index = 0; index < list.length; index++) System.out.print(list[index] + " "); (A) (B) (C) (D) Question 09 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