Take out a piece of paper and PEN.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

Classes and Objects. What is Design? The parts of the software including – what information each part holds – what things each part can do – how the various.
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Recursive Factorial Demo pubic class Factorial {
Polymorphism Method overriding Method overloading Dynamic binding 1.
PreAP Computer Science Quiz
Topic 10 Java Memory Management. 1-2 Memory Allocation in Java When a program is being executed, separate areas of memory are allocated for each class.
Copyright 2010 by Pearson Education Building Java Programs Chapter 7 Lecture 7-2: Arrays as Parameters reading: , 3.3 self-checks: Ch. 7 #5, 8,
Composition CMSC 202. Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing.
AP Computer Science DYRT Quiz Key
1 Chapter 2 Introductory Programs. 2 Getting started To create and run a Java program –Create a text file with a.java extension for the source code. For.
Introduction to Computers and Programming Strings Professor: Evan Korth New York University.
PreAP Computer Science Quiz
Arrays (Part 1) Computer Science Erwin High School Fall 2014.
French Territory of St. Pierre CSE 114 – Computer Science I Arrays.
PreAP Computer Science Quiz
Java Quiz Bowl A fun review of the Java you should know from CMPT 201 If you don’t know the answers - this week is for you to study up!
Computer Science Reading Quiz 6.2 (Sections )
PreAP Computer Science Review Quiz 08 Key
PreAP Computer Science Quiz Key
1 On (computational) simplicity We are trying to teach not just Java, but how to think about problem solving. Computer science has its field called computational.
CSI1390 – Java Programming Methods II Instructor: Saeid Nourian
AP Computer Science DYRT Quiz Key
CS305j Introduction to Computing Classes II 1 Topic 24 Classes Part II "Object-oriented programming as it emerged in Simula 67 allows software structure.
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
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.
CMSC 202 Advanced Section Classes and Objects: Object Creation and Constructors.
AP Computer Science DYRT Quiz
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
© A+ Computer Science - In Java, any variable that refers to an Object is a reference variable. The variable stores the memory.
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.
FUNCTIONS (METHODS) Pascal C, C++ Java Scripting Languages Passing by value, reference Void and non-void return types.
AP Computer Science DYRT Quiz
Output Programs These slides will present a variety of small programs. Each program has a control structure that was introduced in this chapter. Our concern.
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.
MC Question Strategies
Advanced Programming TA Session 2
CSE 143 Lecture 9 References and Linked Nodes reading: 3.3; 16.1
CSC240 Computer Science III
An Introduction to Java – Part II
TO COMPLETE THE FOLLOWING:
Polymorphism.
Section 11.1 Introduction to Data Structures.
Pre-AP® Computer Science Quiz Key
Pre-AP® Computer Science Quiz
Parameter Passing in Java
CS2011 Introduction to Programming I Methods (II)
Take out a piece of paper and PEN.
Simulating Reference Parameters in C
slides created by Ethan Apter
PreAP Computer Science Review Quiz 08
PreAP Computer Science Quiz Key
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
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.
slides created by Ethan Apter
A+ Computer Science PARAMETERS
Lecture 6: References and linked nodes reading: 16.1
CIS 110: Introduction to Computer Programming
Classes and Objects Object Creation
Pre-AP® Computer Science Quiz
CMSC 202 Constructors Version 9/10.
CPSC 233 Tutorial 13 March 11/12th, 2015.
Presentation transcript:

Take out a piece of paper and PEN. Exposure Java 2015 for Teaching AP® Computer Science DYRT Quiz 11.06-09 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.06-09 1. 9. 2. 10. 3. 11. 4. 12. 5. 13. 6. 14. 15. 8. 16.

Question 01 What is the output of the following program segment? int[ ] list = {1,2,3,4,5,6,7,8,9}; for (int number : list) { number++; System.out.print(number + " "); } 0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 10 Runtime exception error

Question 02 What is the output of the following program segment? int[ ] list = {1,2,3,4,5,6,7,8,9}; for (int number : list) number++; for (int number : list) System.out.print(number + " "); 0 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 10 Runtime exception error

Question 03 What is the output of the following Program segment and method? int p = 10; int q = 20; swap(p,q); System.out.println(p + " " + q); public static void swap (int x, int y) { int temp = x; x = y; y = temp; } 10 20 20 10 10 10 20 20 10 20 20 10

Question 04 What is the output of the following Program segment and method? int p = 10; int q = 20; swap(p,q); public static void swap (int x, int y) { int temp = x; x = y; y = temp; System.out.println(x + " " + y); } 10 20 20 10 10 10 20 20 10 20 20 10

Question 05 What is the output of the following Program segment and method? int[ ] list = {111,222,333,444,555}; swap(list,3,4); System.out.println(list[2]+" "+list[3]); public static void swap(int[ ] x, int p, int q) { int temp = x[p]; x[p] = x[q]; x[q] = temp; } 333 444 444 333 555 333 333 555 Runtime Exception error

Question 06 What is the output of the following Program segment and method? int[ ] list = {111,222,333,444,555}; swap(list,1,5); System.out.println(list[2]+" "+list[4]); public static void swap(int[ ] x, int p, int q) { int temp = x[p]; x[p] = x[q]; x[q] = temp; } 111 555 555 111 222 444 444 222 Runtime Exception error

Question 07 “Shallow” values are used by simple, primitive data types only. objects only. simple data only when passing parameters. objects only when passing parameters. both simple data types and objects.

Question 08 “Deep” values are used by simple, primitive data types only. objects only. simple data only when passing parameters. objects only when passing parameters. both simple data types and objects.

Question 09 The Card class stores information about the number of cards in a deck. its location in a deck. its suit, rank and value. its suit color. all of the above.

Question 10 The toString method in the Card class is used for constructing a Card object. for displaying any String attribute values. for displaying the three attribute values. in place of the println method for output. for all of the above.

Question 11 The Card class and the Deck class have class interaction with composition. class interaction with inheritance no class interaction only class interaction between Card objects.

Question 12 In any of the Deck class program examples the call to construct a Card object is located in the Deck class only. the DeckTester class only. either the Deck or DeckTester classes. none of the above.

Question 13 In any of the Deck class program examples the call to construct a cards array object is located in the Deck class only. the DeckTester class only. either the Deck or DeckTester classes. none of the above.

Question 14 In any of the Deck class program examples the call to construct a Deck object is located in the Deck class only. the DeckTester class only. either the Deck or DeckTester classes. none of the above.

Question 15 The toString method of the Deck class uses the toString method of the Card class. displays all the cards in the Deck object. returns a concatenated string of Card objects. does all of the above.

Question 16 The size value of a Deck object Is fixed at 1. is not an attribute of the Deck class. is between 0 and 52.