preap computer science quiz 09.01- 06 key take out a piece of paper and pen. the quiz starts one...
TRANSCRIPT
![Page 1: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/1.jpg)
PreAP Computer ScienceQuiz 09.01- 06 Key
Take out a piece of paper and PEN.
The quiz starts ONE minute after the tardy bell rings.
You will have 30 or 45 seconds per question.
![Page 2: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/2.jpg)
Title the quiz as shown belowThe quiz starts in ONE minute.
Name Period Date
Quiz 09.01-061. 11.2. 12.3. 13.4. 14.5. 15.6. 16.7. 17.8. 18.9. 19.10. 20.
EC.
![Page 3: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/3.jpg)
Question 01
Inheritance describes what type of relationship?
(a) “is-a”
(b) “has-a”
![Page 4: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/4.jpg)
Question 02
Composition describes what type of relationship?
(a) “is-a”
(b) “has-a”
![Page 5: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/5.jpg)
Question 03
Which of the following shows an example of an inheritance relationship?
(a) dog cat
(b) house door
(c) hanger shelf
(d) student person
![Page 6: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/6.jpg)
Question 04
Which of the following shows an example of a composition relationship?
(a) dog cat
(b) house door
(c) hanger shelf
(d) student person
![Page 7: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/7.jpg)
Question 05
Inheritance involves the use of at least twoclasses. The existing (and more general) class is called the
(a) superclass.(b) default class.(c) overloaded class.(d) subclass.
![Page 8: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/8.jpg)
Question 06
Inheritance involves the use of at least twoclasses. The new and improved class whichuses inheritance is called the
(a) superclass.(b) default class.(c) overloaded class.(d) subclass.
![Page 9: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/9.jpg)
Question 07
Which single Java keyword indicates thatinheritance is used?
(a) isa(b) hasa(c) extends(d) inherits
![Page 10: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/10.jpg)
Question 08
True or False
When an object of a subclass is instantiated,the constructor of the superclass is called first.
(a) True (b) False
![Page 11: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/11.jpg)
Question 09
True or False
Methods of a subclass have access to theprivate data of a superclass.
(a) True (b) False
![Page 12: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/12.jpg)
Question 10
True or False
Methods of a subclass have access to the public data of a superclass.
(a) True (b) False
![Page 13: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/13.jpg)
Question 11
True or False
Methods of a subclass have access to the protected data of a superclass.
(a) True (b) False
![Page 14: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/14.jpg)
Question 12
The Geometry analogy which states thata square is a rectangle is an example of
(a) encapsulation.(b) concatenation.(c) inheritance.(d) polymorphism.(e) composition.
![Page 15: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/15.jpg)
Question 13
How should super class data be declared if you want to grant direct access to subclass methods, but you do not want to grant direct access to methods of all classes?
(a) public(b) private(c) protected
![Page 16: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/16.jpg)
Question 14
True or False
Inheritance is limited to two levels with two classes.
(a) True (b) False
![Page 17: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/17.jpg)
Which of these is possible in C++, but not in Java?
(a) multi-level inheritance
(b) multiple inheritance
(c) composition
(d) inheritance and composition
(e) several subclasses inheriting from one superclass
Question 15
![Page 18: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/18.jpg)
Question 16
Animal
Mammal
Dog
Terrier
Look at this graphic. What is this an example of?
(a) multi-level inheritance(b) multiple inheritance(c) composition(d) inheritance and composition(e) several subclasses inheriting
from one superclass
![Page 19: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/19.jpg)
Question 17Look at this graphic. What is this an example of?
(a) multi-level inheritance(b) multiple inheritance(c) composition(d) inheritance and composition(e) several subclasses inheriting
from one superclass
![Page 20: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/20.jpg)
Question 18
Reptile
Dinosaur
Extinct
Look at this graphic. What is this an example of?
(a) multi-level inheritance(b) multiple inheritance(c) composition(d) inheritance and composition(e) several subclasses inheriting
from one superclass
![Page 21: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/21.jpg)
Question 19Look at this graphic. What is this an example of?
(a) multi-level inheritance(b) multiple inheritance(c) composition(d) inheritance and composition(e) several subclasses inheriting
from one superclass
![Page 22: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/22.jpg)
Question 20Look at this graphic. What is this an example of?
(a) multi-level inheritance(b) multiple inheritance(c) composition(d) inheritance and composition(e) several subclasses inheriting
from one superclass
![Page 23: PreAP Computer Science Quiz 09.01- 06 Key Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 or](https://reader036.vdocuments.net/reader036/viewer/2022081417/5697c0281a28abf838cd6e40/html5/thumbnails/23.jpg)
Extra CreditIn the Fish class case study, Fish4 inherits from Fish3. Fish3 has a moveFish method. Fish4 also has a moveFish method. What does this mean?
(a) The moveFish method of Fish4 is a constructor.
(b) The moveFish method of Fish3 is a constructor.
(c) Fish4 re-defined the moveFish method.
(d) Fish4 is a superclass of Fish3
(e) Fish4 cannot compile.