PreAP Computer Science Quiz 11.03- 05 Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 – 60 seconds.

Slides:



Advertisements
Similar presentations
Copyright © 2002 Pearson Education, Inc. Slide 1.
Advertisements

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.
The simple built-in data types of the C language such as int, float, - are not sufficient to represent complex data such as lists, tables, vectors, and.
Introduction to arrays
PreAP Computer Science Quiz
One Dimensional Arrays
Programming with Collections Collections in Java Using Arrays Week 9.
Arrays-Part 1. Objectives Declare and initialize a one-dimensional array Store data in a one-dimensional array Display the contents of a one-dimensional.
©2004 Brooks/Cole Chapter 8 Arrays. Figures ©2004 Brooks/Cole CS 119: Intro to JavaFall 2005 Sometimes we have lists of data values that all need to be.
© The McGraw-Hill Companies, 2006 Chapter 5 Arrays.
Array Must declare a variable to reference the array double [] mylist; // cannot double list[20]; Or double mylist[]; The declaration doesn’t allocate.
CS 106 Introduction to Computer Science I 03 / 03 / 2008 Instructor: Michael Eckmann.
LAB-10 1-D Array I Putu Danu Raharja Information & Computer Science Department CCSE - King Fahd University of Petroleum & Minerals.
PreAP Computer Science Quiz
More Arrays Length, constants, and arrays of arrays By Greg Butler.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
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.
EGR 2261 Unit 8 One-dimensional Arrays  Read Malik, pages in Chapter 8.  Homework #8 and Lab #8 due next week.  Quiz next week.
ARRAYS 1 Week 2. Data Structures  Data structure  A particular way of storing and organising data in a computer so that it can be used efficiently 
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 )
Page 1 Quiz by Joseph Lindo. Page 2 Program Analysis by providing the output of a program snippet Some are true or false Some have choices.
PreAP Computer Science Review Quiz 08 Key
PreAP Computer Science Quiz Key
Computer Programming 12 Mr. Jean April 24, The plan: Video clip of the day Upcoming Quiz Sample arrays Using arrays More about arrays.
Advanced Computer Science Lesson 4: Reviewing Loops and Arrays Reading User Input.
Week # 2: Arrays.  Data structure  A particular way of storing and organising data in a computer so that it can be used efficiently  Types of data.
PreAP Computer Science Quiz
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
PreAP Computer Science Quiz Key
 2008 Pearson Education, Inc. All rights reserved. 1 Arrays and Vectors.
Output Programs These slides will present a variety of small programs. Each program has some type of array that was introduced in this chapter. Our concern.
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
COMPUTER PROGRAMMING. Array C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An.
Arrays An array is an indexed data structure which is used to store data elements of the same data type. An array is an indexed data structure which is.
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.
Review. Problem 1 What is the output of the following piece of code void increment(int x) { x++; } int main() { int y = 10; increment(y); cout
Arrays in java Unit-1 Introduction to Java. Array There are situations where we might wish to store a group of similar type of values in a variable. Array.
© Janice Regan, CMPT 128, January CMPT 128: Introduction to Computing Science for Engineering Students Introduction to Arrays.
MULTI-DIMENSIONAL ARRAYS 1. Multi-dimensional Arrays The types of arrays discussed so far are all linear arrays. That is, they all dealt with a single.
1 CSC103: Introduction to Computer and Programming Lecture No 17.
AP Computer Science DYRT Quiz
Arrays. What is an array? An array is a collection of data types. For example, what if I wanted to 10 different integers? int num1; int num2; int num3;
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.
Section 11.1 Introduction to Data Structures.
Pre-AP® Computer Science Quiz Key
Pre-AP® Computer Science Quiz
Take out a piece of paper and PEN.
CISC181 Introduction to Computer Science Dr
PreAP Computer Science Review Quiz 08
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.
PowerPoint Presentation Authors of Exposure Java
PowerPoint Presentation Authors of Exposure Java
Take out a piece of paper and PEN.
Take out a piece of paper and PEN.
AP Computer Science DYRT Quiz
Take out a piece of paper and PEN.
Pre-AP® Computer Science Quiz
Presentation 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 <= 8; index++) System.out.print(list[index] + " "); (A) (B) (C) (D)

Question 10 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}; (a)for (int k = 1; k <= 9; k++) System.out.println(list[k]); (b)for (int k = 1; k < 9; k++) System.out.println(list[k]); (c)for (int k = 0; k < 9; k++) System.out.println(list[k]); (d)for (int k = 0; k <= 9; k++) System.out.println(list(k));

Question 11 What type of values are stored in list by the following program segment? int list[ ] = new int[20]; for (int k = 0; k < 20; k++) list[k] = Expo.random(0,1000); (A) A set of integers in the [1..20] range (B) 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

Question 12 Which Arrays method allows you to display the contents of an array with a single statement, like System.out.print or System.out.println ? (a)show (b)toString (c)display (d)output

Question 13 Which Arrays method assigns the same value to every array element? (a)assign (b)alter (c)fill (d)place

Question 14 Which Arrays method searches for a specified array value and then returns the index? (a)binarySearch (b)returnIndex (c)searchValue (d)linearSearch

Question 15 When will the binarySearch method of the Arrays class not perform correctly? (a)When a for loop is used. (b)When a while loop is used. (c)When the array elements are sorted. (d)When the array elements are not sorted.

Question 16 What is the output of this program segment? int list[ ] = {22,33,11,55,44}; Arrays.sort(list); System.out.println(Arrays.toString(list)); (A) (B)[22, 33, 11, 55, 44] (C) (D)[11, 22, 33, 44, 55] (E)There is no output without a loop structure.

Extra Credit What is the output of this program segment? int numbers[ ] = {10,11,12,13,14,15,16,17,18,19,20}; int rand = Expo.random(0,6); System.out.println(numbers[rand]); (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