Docsity

DREXEL SE310 (MIDTERM) SOFTWARE Latest, Exams of Nursing

Toggle sidebar
bg1
DREXEL SE310 (MIDTERM) SOFTWARE
DESIGN PATTERNS EXAM NEWEST ACTUAL
EXAM WITH COMPLETE QUESTIONS AND
DETAILED VERIFIED ANSWERS GRADED A+
| 100% VERIFIED
The faรงade pattern does not promote loose coupling because
the client is tightly coupled to the underlying sub classes
encapsulated by the interface. -
โœ”โœ”โœ”
Correct Answer > False
The faรงade pattern promotes loose coupling because if
anything changes in the subclasses that doesn't affect the
public interface of the client isn't effected.
The bridge pattern does not promotes loose coupling because
the abstractions are tightly coupled to the implementations by
the interface. -
โœ”โœ”โœ”
Correct Answer > False
TeslaModelS.accelerate(); -
โœ”โœ”โœ”
Correct Answer > The
accelerate() method defined in ElectricCar will be called.
Latest.
Page 1 of 11
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download DREXEL SE310 (MIDTERM) SOFTWARE Latest and more Exams Nursing in PDF only on Docsity!

DREXEL SE310 (MIDTERM) SOFTWARE

DESIGN PATTERNS EXAM NEWEST ACTUAL

EXAM WITH COMPLETE QUESTIONS AND

DETAILED VERIFIED ANSWERS GRADED A+

| 100% VERIFIED

The faรงade pattern does not promote loose coupling because the client is tightly coupled to the underlying sub classes

encapsulated by the interface. - โœ”โœ”โœ” Correct Answer > False

The faรงade pattern promotes loose coupling because if anything changes in the subclasses that doesn't affect the public interface of the client isn't effected. The bridge pattern does not promotes loose coupling because the abstractions are tightly coupled to the implementations by

the interface. - โœ”โœ”โœ” Correct Answer > False

TeslaModelS.accelerate(); - โœ”โœ”โœ” Correct Answer > The

accelerate() method defined in ElectricCar will be called.

Latest.

This is a straight inheritance question. Since TeslaModelS is an object instantiated from the ElectricCar class, the method assoicated with ElectricCar is called.

Functional Decomposition - โœ”โœ”โœ” Correct Answer > is the

process of taking a complex process and breaking it down into its smaller, simpler parts.

Delegation - โœ”โœ”โœ” Correct Answer > refers to one object

relying upon another to provide a specified set of functionalities

Cohesion - โœ”โœ”โœ” Correct Answer > refers to the degree to

which the elements of a module belong together. - weak strong

Coupling - โœ”โœ”โœ” Correct Answer > is the manner and degree of

interdependence between software modules

Conceptual Level View of an Object - โœ”โœ”โœ” Correct Answer >

An object is a set of responsibilities.

Constructor - โœ”โœ”โœ” Correct Answer > A constructor is a special

type of subroutine called to create an object. In java if you do not create one a default one is created for you. You call the constructor by using the keyword new , followed by the name of the class, followed by any necessary parameters An is-a relationship is one between a class that aggregates

another class. - โœ”โœ”โœ” Correct Answer > False

Is-a relationships are relationships between classes that inherit from one another. A derived class is a form of a base class. A has a relationship is between to object where one is

composed/aggregated by the other. - โœ”โœ”โœ” Correct Answer >

True This is a true statement. Has-a relationships are when one object contains another. A computing system controls many devices the CPU, hard drive, and RAM. Each have many settings. ie. CPU ( set speed, set # of cores, power on power off), Hard Drive (read sector, read byte, write sector, write byte, power on, power off), RAM (read byte,

write byte, power on, power off). A programmer could code against the components directly to put the computer to sleep/hibernate or restore from sleep/hibernate. Instead, an interface is created encapsulating the interfaces to the components so that a programmer can now code to a new interface sleep() and hibernate(). This is an example of

creating/using a: - โœ”โœ”โœ” Correct Answer > facade

The programming construct used to solve the problem is a facade because they are wrapping the interface of an existing system to an new interface. This is different than an adapter where there is an existing interface to code to. A computing system controls many devices the CPU, hard drive, and RAM. Each have many settings. ie. CPU ( set speed, set # of cores, power on power off), Hard Drive (read sector, read byte, write sector, write byte, power on, power off), RAM (read byte, write byte, power on, power off). A programmer does not like the interface provided by the sub system and wants to integrate the functionality provided into an existing interface so that they may access the functionality polymorphically. The

programmer is building a - โœ”โœ”โœ” Correct Answer > adapter

The programming construct used to solve the problem is an adapter because they are wrapping the interface of an existing

Adapter Implementation - โœ”โœ”โœ” Correct Answer > Will usually

contain some form of aggregation. Taking a different chunk of code and wrapping it in a class using familiar functions. By using the keyword static, you not longer have to instantiate an object of the class in order to access it's methods. An example of this is the math library, where you would access the methods without actually instantiating a math object. An abstract class can have abstract and non-abstract methods. -

โœ”โœ”โœ” Correct Answer > True

If a class is abstract it means it can't be instantiated, but one of the great aspects of an abstract class over an interface is that it allows the programmer to create methods that are common to all derived classes. An interface can have abstract and non-abstract methods. -

โœ”โœ”โœ” Correct Answer > False

An interface defines what the methods must be implemented by a class implementing the interface. It defines the protocol for calling the method, but it does not actually have methods.

An abstract class supports multiple inheritance - โœ”โœ”โœ” Correct

Answer > False Java does not support multiple inheritance in classes.

An interface supports multiple inheritance - โœ”โœ”โœ” Correct

Answer > True Technically, you could argue java doesn't support multiple inheritance, but interfaces do a close job of approximating it. You are not really wrong if you answered this question as F. An abstract class can have final, non-final, static and non-static

variables. - โœ”โœ”โœ” Correct Answer > True

This is just a good definition to know. I didn't specifically cover this in class, but added it here to let you know it if you haven't studied it closely. An interface can have final, non-final, static and non-static

variables. - โœ”โœ”โœ” Correct Answer > False

An abstract class can provide the implementation of an

interface. - โœ”โœ”โœ” Correct Answer > True

Abstract classes can implement methods. As long as all the methods with the right prototypes are declared, then the abstract class can implement the interface. An interface can provide the implementation of an abstract

class - โœ”โœ”โœ” Correct Answer > False

Static variables are stored only once for all instances of the

class. A class constant is equivalent to it. - โœ”โœ”โœ” Correct

Answer > False A class constant is created using the keyword final. It can't be changed. A static variable is instantiated once for the entire class, but it can be changed. A static data method can access static variable as well as be

invoked without an object. - โœ”โœ”โœ” Correct Answer > True

Interfaces do not provide an implementation of any classes, they define what methods classes that implement them must implement.

#1 Reason projects fail - โœ”โœ”โœ” Correct Answer > Poor

requirements gathering. also due to communication problems. We must design to accommodate change. A class Car and its subclass ElectricCar both have a method accelerate() which was written by the programmer as part of the class definition. If TeslaModelS refers to an object of type ElectricCar, what will the following code do?