SE310 UPDATED EXAMS SCRIPT QUESTIONS AND
ANSWERS SURE A+
✔✔Accessibility: Protected - ✔✔Only objects of this class and derived classed can see
it.
"#"
✔✔Accessibility: Private - ✔✔Only objects from this class can see it.
"-"
✔✔Special Methods: Constructors - ✔✔Initialize or set up an object
✔✔Special methods: Destructors - ✔✔Finalize or clean up an object when it is no
longer needed.
✔✔UML: Package - ✔✔Collection of Interfaces and classes
✔✔UML: Interface - ✔✔Should start with I. Can be used as an abstract class.
✔✔UML: Class - ✔✔properties or attributes sit at top.
Methods or operations at the bottom.
+ public
# protected
, - private
✔✔UML Inheritance - ✔✔B inherits from A
"is-a" Relationship
B -> A
Additional data members, methods are added in the child class.
Overridden methods are in the child class.
✔✔UML Generalization - ✔✔B Implements A
B -> A
✔✔UML Association - ✔✔A and B call eachother.
A -- B
✔✔UML Aggregation - ✔✔A "has-a" Instance of B.
B can survive if A is disposed.
A<>--B
✔✔UML Composition - ✔✔A has an instance of B, B cannot exist if A is disposed.
A<>--B
✔✔UML Container Class - ✔✔Shows the contained objects in one class.
The contained objects have a scope.
Contained objects hace multiplicity/cardinality.
(Blackjack in photo example)
✔✔UML Dependency (one way association) - ✔✔A can call B's properties or methods.
Not the other way around.
A->B
An object of one class might use an object of another class in the code of a method.
✔✔Cohesion - ✔✔A module should have well-defines responsibilities.
✔✔Low Cohesion - ✔✔bad programming design.
A module should have well-defines responsibilities.
✔✔High Cohesion - ✔✔A module has well-defined responsibilities.
Good programming design.
✔✔Coupling - ✔✔The degree of interdependence between software modules.
How closely connected two routines or modules are.
The extent to which a class knows about the other class.
✔✔Tight Coupling - ✔✔two modules or routines are closely connected.
A class knows a lot about another class.
ANSWERS SURE A+
✔✔Accessibility: Protected - ✔✔Only objects of this class and derived classed can see
it.
"#"
✔✔Accessibility: Private - ✔✔Only objects from this class can see it.
"-"
✔✔Special Methods: Constructors - ✔✔Initialize or set up an object
✔✔Special methods: Destructors - ✔✔Finalize or clean up an object when it is no
longer needed.
✔✔UML: Package - ✔✔Collection of Interfaces and classes
✔✔UML: Interface - ✔✔Should start with I. Can be used as an abstract class.
✔✔UML: Class - ✔✔properties or attributes sit at top.
Methods or operations at the bottom.
+ public
# protected
, - private
✔✔UML Inheritance - ✔✔B inherits from A
"is-a" Relationship
B -> A
Additional data members, methods are added in the child class.
Overridden methods are in the child class.
✔✔UML Generalization - ✔✔B Implements A
B -> A
✔✔UML Association - ✔✔A and B call eachother.
A -- B
✔✔UML Aggregation - ✔✔A "has-a" Instance of B.
B can survive if A is disposed.
A<>--B
✔✔UML Composition - ✔✔A has an instance of B, B cannot exist if A is disposed.
A<>--B
✔✔UML Container Class - ✔✔Shows the contained objects in one class.
The contained objects have a scope.
Contained objects hace multiplicity/cardinality.
(Blackjack in photo example)
✔✔UML Dependency (one way association) - ✔✔A can call B's properties or methods.
Not the other way around.
A->B
An object of one class might use an object of another class in the code of a method.
✔✔Cohesion - ✔✔A module should have well-defines responsibilities.
✔✔Low Cohesion - ✔✔bad programming design.
A module should have well-defines responsibilities.
✔✔High Cohesion - ✔✔A module has well-defined responsibilities.
Good programming design.
✔✔Coupling - ✔✔The degree of interdependence between software modules.
How closely connected two routines or modules are.
The extent to which a class knows about the other class.
✔✔Tight Coupling - ✔✔two modules or routines are closely connected.
A class knows a lot about another class.