Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

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:

Images intgres 2

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

image text in transcribed
image text in transcribed
QUESTION 8 Questions 8, 9 and 10 uses the following heiarchy PostalCode PostalTest toString() gekCode) getDestination) setDestination validate) PostalCodeException moin gerCountry0 BritishPostalCode validate gelCountry) CanadianPostalCode validate) gelCountry0) USZipCode validate() gelCountry)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions