PreAP Computer Science Quiz Key

Slides:



Advertisements
Similar presentations
This is Java Jeopardy Writing Methods…chapter 4…
Advertisements

PreAP Computer Science Quiz
AP Computer Science DYRT Quiz Key
9. Inheritance 9.1 Subclasses 9.2 Polymorphism 9.3 Abstract Classes 9.4 Modifiers and Access 9.6 Object-Oriented Design with Use Cases and Scenarios.
Road Map Introduction to object oriented programming. Classes
CS 106 Introduction to Computer Science I 03 / 21 / 2008 Instructor: Michael Eckmann.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
What is a class? a class definition is a blueprint to build objects its like you use the blueprint for a house to build many houses in the same way you.
Terms and Rules Professor Evan Korth New York University (All rights reserved)
8.1 Classes & Inheritance Inheritance Objects are created to model ‘things’ Sometimes, ‘things’ may be different, but still have many attributes.
Fall 2005CSE 115/503 Introduction to Computer Science I1 Composition details Recall, composition involves 3 things: –Declaration of instance variable of.
PreAP Computer Science Quiz
PreAP Computer Science Quiz
PreAP Computer Science Quiz
Object Oriented Programming (OOP) is a style of programming that incorporates these 3 features: Encapsulation Polymorphism Class Interaction Object.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
PreAP Computer Science Quiz
Computer Science Reading Quiz 6.2 (Sections )
PreAP Computer Science Review Quiz 08 Key
PreAP Computer Science Quiz Key
ECE122 Feb. 22, Any question on Vehicle sample code?
Chapter 11: Introduction to Classes. In this chapter you will learn about: – Classes – Basic class functions – Adding class functions – A case study involving.
CS0007: Introduction to Computer Programming Classes: Documentation, Method Overloading, Scope, Packages, and “Finding the Classes”
Classes. Constructor A constructor is a special method whose purpose is to construct and initialize objects. Constructor name must be the same as the.
1 Chapter 5: Defining Classes. 2 Basics of Classes An object is a member of a class type What is a class? Fields & Methods Types of variables: –Instance:
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
Take out a piece of paper and PEN.
Topic 8Classes, Objects and Methods 1 Topic 8 l Class and Method Definitions l Information Hiding and Encapsulation l Objects and Reference Classes, Objects,
PreAP Computer Science Quiz
// Java2101.java This program tests the features of the class. public class Java2101 { public static void main (String args[]) { System.out.println("\nJAVA2101.JAVA\n");
Take out a piece of paper and PEN.
Non-Static Classes What is the Object of this lecture?
AP Java Ch. 4 Review Question 1  Java methods can return only primitive types (int, double, boolean, etc).
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.
5.1 Basics of defining and using classes A review of class and object definitions A class is a template or blueprint for an object A class defines.
AP Computer Science DYRT Quiz
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Object Based Programming Chapter 8. 2 Contrast ____________________ Languages –Action oriented –Concentrate on writing ________________ –Data supports.
Object Oriented Programming (OOP) is a style of programming that incorporates these 3 features: Encapsulation Polymorphism Inheritance Object Oriented.
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.
Exposure Java 2013 APCS Edition
Section 8.2 OOP A Gentle First Exposure.
Haidong Xue Summer 2011, at GSU
Microsoft Visual Basic 2005: Reloaded Second Edition
Chapter 3: Using Methods, Classes, and Objects
Road Map Introduction to object oriented programming. Classes
CS 302 Week 11 Jim Williams, PhD.
Object Based Programming
Defining Classes and Methods
Section 8.7 The Consequences of Scope.
Pre-AP® Computer Science Quiz Key
Pre-AP® Computer Science Quiz
Interfaces.
Implementing Classes Chapter 3.
© A+ Computer Science - OOP © A+ Computer Science -
Take out a piece of paper and PEN.
PreAP Computer Science Review Quiz 08
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.
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 08.04- 05 Key Take out a piece of paper and PEN. The quiz starts ONE minute 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 08.04-05 1. 9. 2. 10. 3. 11. 4. 12. 5. 13. 6. 14. 7. 15. 8. EC.

Question 01 Which Java keyword is used to instantiate or construct an object? construct instantiate new create

Question 02 A constructor is a method. has the same name as the class. is neither a void method nor a return method. is all of the above.

Question 03 Which of the following statements is true? A class can have only one constructor. Overloaded constructors have the same signature. A class can have multiple constructors. Constructors make a class less reliable.

Question 04 Class members need to be declared as private or public. overloaded. constructors. attributes.

Question 05 Class members that are declared private can only be accessed by members of the same class. only be accessed by members of the same file. be accessed from anywhere. never be accessed.

Question 06 Class members that are declared public can only be accessed by members of the same class. only be accessed by members of the same file. be accessed from anywhere. never be accessed.

Question 07 Class attributes are usually declared public. private. final. in a different file from the class methods.

Question 08 Class methods are usually declared public. private. final. in a different file from the class attributes.

Question 09 What is true of the program code below? class Bank { } It is an incomplete class, which cannot compile. It is a minimum class, which does compile. It is the Bank constructor. It is an overloaded method.

Question 10 What is shown by the two program statements? Bank tom = new Bank(); Bank sue = new Bank(1000.0,5000.0); Overloading constructors Void methods Return methods Class Interaction

Question 11 The Bank class is an example of a class that uses object methods. overloaded constructors. void methods. return methods. all of the above.

Question 12 Which method is neither a return method nor a void method? A public method A class method An object method A constructor method

Question 13 Accessing or get methods are used to retrieve attribute values. alter attribute values. initialize attribute values. destroy attribute values.

Question 14 Modifier, Mutator or set methods are used to retrieve attribute values. alter attribute values. initialize attribute values. destroy attribute values.

Question 15 Constructor methods are used to retrieve attribute values. alter attribute values. initialize attribute values. destroy attribute values.

Piggy tom = new Piggy(); Extra Credit Consider the statement below. Piggy tom = new Piggy(); The first Piggy is the class name. What is the second Piggy identifier? A second class name The constructor name The class parameter The object name