Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 1 Which of the following represent good superclass-subclass pairs (generalizations)? The superclass is on the left while the sub class is on the right.
QUESTION 1
Which of the following represent good superclass-subclass pairs (generalizations)? The superclass is on the left while the sub class is on the right. Hint: Look for violations of the isA rule, poor naming, and other problems. (Multiple Answers)
a.
Money CanadianDollars
b.
Bank Account
c.
SavingsAccount CheckingAccount
d.
Account Account12876
e.
Person Customer
f.
Student GraduateStudent
g.
Continent Country
QUESTION 2
Select all of the following that most likely indicate a class (all others indicate an instance of a class). Ignore case when selecting your answer. (Multiple answers)
a.
GeneralMotors
b.
AutomobileCompany
c.
Boeing777
d.
ComputerScienceStudent
e.
MarySmith
f.
Game
g.
BoardGame
h.
UniversityCourseSeg2100
i.
Airplane
j.
ThegameofchessbetweenTomAndJaneAt2:30pmYesterday
k.
TheCarWithSerialNoJM198765T4
QUESTION 3
Which of the following classes would be declared in a Weather Forecasting System?
a.
Forecast
b.
WeatherMap
c.
WeatherSymbol
d.
WeatherSystem
e.
All of the above are correct
QUESTION 4
Which of the classes would be declared in a Video Rental System?
a.
Customer
b.
VideoEditing
c.
VideoEnhancement
d.
Audio
e.
All of the above are correct
QUESTION 5
Which of the following attributes would be found in a Classroom class declared within a University Scheduling System?
a.
semester
b.
startTime
c.
endTime
d.
roomNumber
e.
All of the above
QUESTION 6
Which of the following would be an appropriate Superclass for the following subclasses?
Truck Ambulance Bus
a.
Car
b.
Driver
c.
Vehicle
d.
Train
QUESTION 7
Chapter 7 uses the following hierarchy:
Leaf classes are concrete while all non-leaf classes are abstract. Which of the following object-method pairs would require dynamic binding? (Multiple Answers)
a.
Object Type Method Name
Rectangle getPerimeterLength
b.
Object Type Method Name
SimplePolygon getCenter
c.
Object Type Method Name
Polygon getBoundingRect
d.
Object Type Method Name
EllipticalShape changeScale
e.
Object Type Method Name
RegularPolygon translate
QUESTION 8
Questions 8, 9 and 10 uses the following heiarchy:
Images intgres 1
Which of the following methods in PostalCode would most appropriately be implemented as abstract?
a.
getCode
b.
getDestination
c.
validate
d.
setDestination
QUESTION 9
Which of the following classes would most likely be implemented as abstract?
a.
PostalCodeException
b.
PostalTest
c.
CanadianPostalCode
d.
PostalCode
QUESTION 10
Which of the following classes most like be implemented as final?
a.
PostalCode
b.
USZipCode
c.
Either a or b could be implemented as final
d.
Neither a or b could ever be implemented as final
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started