Take out a piece of paper and PEN.

Slides:



Advertisements
Similar presentations
Etter/Ingber Arrays and Matrices. Etter/Ingber One-Dimensional Arrays 4 An array is an indexed data structure 4 All variables stored in an array are of.
Advertisements

PreAP Computer Science Quiz
AP Computer Science DYRT Quiz Key
© The McGraw-Hill Companies, 2006 Chapter 5 Arrays.
PreAP Computer Science Quiz
PreAP Computer Science Quiz
Review of Simple/Primitive Data Types A simple/primitive data type can store only one single value. This means an int can only store one integer. A double.
PreAP Computer Science Quiz
Arrays (Part 1) Computer Science Erwin High School Fall 2014.
PreAP Computer Science Quiz
Introduction to Arrays in Java Corresponds with Chapter 6 of textbook.
Computer Science 210 Computer Organization Arrays.
First Data Structure Definition A data structure is a data type whose components are smaller data structures and/or simple data types.
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
Computer Science Reading Quiz 6.2 (Sections )
PreAP Computer Science Review Quiz 08 Key
PreAP Computer Science Quiz Key
Advanced Computer Science Lesson 4: Reviewing Loops and Arrays Reading User Input.
AP Computer Science DYRT Quiz Key
Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 45 – 90 seconds per question. Determine the output.
PreAP Computer Science Quiz
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
Review of Simple/Primitive Data Types A simple/primitive data type can store only one single value. This means an int can only store one integer. A.
Take out a piece of paper and PEN.
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.
© Janice Regan, CMPT 128, January CMPT 128: Introduction to Computing Science for Engineering Students Introduction to Arrays.
First Data Structure Definition A data structure is a data type whose components are smaller data structures and/or simple data types.
AP Computer Science DYRT Quiz
Lecture 7: Arrays Michael Hsu CSULA 3 Opening Problem Read one hundred numbers, compute their average, and find out how many numbers are above the average.
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. Exposure Java 2014 for.
ARRAYS (Extra slides) Arrays are objects that help us organize large amounts of information.
Introduction to Algorithms
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
Two-Dimensional Arrays
Complex data types Complex data types: a data type made of a complex of smaller pieces. Pascal has four very commonly used complex data types: strings,
A simple way to organize data
Arrays! Introduction to Data Structures.
C++ Arrays.
Chapter 10 Slides Java Static 1D & 2D Arrays.
Arrays ICS 111: Introduction to Computer Science I
Peer Instruction 6 Java Arrays.
Chapter 6 Arrays Solution Opening Problem
Section 11.1 Introduction to Data Structures.
An Introduction to Java – Part I, language basics
Pre-AP® Computer Science Quiz Key
Pre-AP® Computer Science Quiz
Arrays We often want to organize objects or primitive data in a way that makes them easy to access and change. An array is simple but powerful way to.
Arrays November 8, 2017.
int [] scores = new int [10];
Arrays .
CS2011 Introduction to Programming I Arrays (I)
int [] scores = new int [10];
Take out a piece of paper and PEN.
CISC181 Introduction to Computer Science Dr
Introduction to Algorithms
PreAP Computer Science Review Quiz 08
Single-Dimensional Arrays chapter6
PreAP Computer Science Quiz Key
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
Take out a piece of paper and PEN.
Take out a piece of paper and PEN.
CS150 Introduction to Computer Science 1
AP Computer Science DYRT Quiz
Peer Instruction 4 Control Loops.
Take out a piece of paper and PEN.
Why are arrays useful? We can use arrays to store a large amount of data without declaring many variables. Example: Read in a file of 1000 numbers, then.
Intro to Arrays Storing List of Data.
Pre-AP® Computer Science Quiz
Presentation transcript:

Take out a piece of paper and PEN. Exposure Java 2015 for Teaching AP® Computer Science DYRT Quiz 11.01-05 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.

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

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.

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

Question 03 The language FORTRAN introduced the array record file

Question 04 The language COBOL introduced the array record list file

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.

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.

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.

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

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

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.

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

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

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

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

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

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

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

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) 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 2 3 4 5 6 7 8 9

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) 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 2 3 4 5 6 7 8 9

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));

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 [0..1000] range

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