Object Oriented Design
Week 4 Final Quiz Answer | Coursera
About this Course
Module 4 Final Quiz
Question 1)
The first stage of the two-stage design process is design.
Hint: This stage has activities like creating CRC cards, talking with the customer about their requirements, and creating mockups.
Ans:
Question 2)
The second stage of the two-stage design process is design.
Hint: This is when you will define the structure of the code and start turning your mockups into classes.
Ans:
Question 3)
Which of these conceptual design techniques will help you analyze the problem space to
determine classes for your object-oriented software? Choose the two correct answers.
- tradeoffs
- requirements
- CRC
- mockups
Question 4)
During conceptual design, once the problem is mapped into components, what are the other two critical pieces of information that you must specify for these classes or components? Choose the two correct answers.
- abstract data types
- responsibilities
- collaborators
- methods
Question 5)
You are writing the CRC card for a Bear component. Choose the two responsibilities.
- den
- eat berries
- hunger
- camper
Question 6)
You are writing the CRC card for a Bear component. Choose the three collaborators.
- bear
- den
- tree
- computer
- guitar
Question 7)
You create an object that represents a user, storing important information about them such as their preferences. What kind of object is this?
- boundary
- entity
- client
- control
Question 8)
You create an object that represents a dialog box. It creates buttons and text fields, etc, for the user to interact with, and it logs those interactions. What kind of object is this?
- display
- boundary
- entity control
- interaction
Question 9)
You create an object that compares values from two different sources. It then updates the smaller value to be equal to the larger one. What kind of object is this?
- control
- repository
- update
- entity
Question 10)
Which of these is an example of a quality tradeoff?
- Limiting features knowing that they can be added later
- Adding security knowing it will reduce speed
- Not delivering key features so that deadlines can be met
- Adding preferences that allow users to switch some features on and off
Question 11)
What is the term for reducing a class or object to its inputs and outputs in modelling?
- pipe thinking
- process thinking
- filter thinking
- black box thinking
Question 12)
Which one of these classes is in most need of being decomposed?
- Order
- Store
- Student
- Book
Question 13)
In order to provide good encapsulation, fill-in-the-blanks on this UML class diagram: (Replace the underscores _ from top to bottom with minus signs ("-") or plus signs ("+"); your answer will be a string of six + or - signs with no spaces)
Ans:
Question 14)
You are writing a simple soccer video game. Select the best example of proper abstraction:
- a)
- b)
- c)
- d)
Question 15)
Which design principle enables developers to follow the guideline D.R.Y. ("Don't Repeat
Yourself");
- encapsulation
- abstraction
- generalization
- decomposition
Question 16)
Which of these UML class diagrams shows an association relationship?
- a)
- b)
- c)
- d)
Question 17)
Which of these UML class diagrams depicts an aggregation ("has-a") relationship between the two classes?
- a)
- b)
- c)
- d)
Question 18)
Which of these UML class diagrams depicts a composition, or a strong "has-a" relationship?
- a)
- b)
- c)
- d)
Question 19)
Select the object pairing that has an association relationship:
- Tree - Root
- Hiker - Trail
- Coffee - Water
- Book - Page
Question 20)
Select the object pairing that has an aggregation relationship:
- Book - Page
- Car - Road
- Pie - Crust
- Stapler - Staple
Question 21)
Select the object pairing that has a composition relationship:
- Book - Page
- Tea - Sugar
- Bear - Forest
- Record Player-Record -
Question 22)
Choose the two answers that correctly complete the following sentence:
"We say that a class has low cohesion if..."
- ...its purpose is unclear.
- ...it tries to encapsulate too many unrelated responsibilities.
- ...it does not have all the necessary parts, i.e. it is incomplete.
- ...connects to many other classes.
Question 23)
Two classes are tightly coupled. What are some ways you might be able to tell? Choose the two correct answers.
- They are very highly reliant on each other
- Their interactions are limited and controlled
- They can easily be swapped with different implementations of the same class
- In order to understand one class, you need to open up the other to look at the implementation
Question 24)
How can you apply the principle of Separation of Concerns in object-oriented programming?
- Separate objects or components according to their role in the software
- Ensure classes are only concerned with their own data
- Split developers into teams that each deal with different parts of the software
- Separate data and actions (methods) into different classes
Question 25)
Which of these violates Liskov's Substitution Principle?
- the superclass is too general
- the subclass adds behaviour
- subclasses specify the abstract methods of the superclass
- an operation in the superclass is replaced by a different operation in the subclass
Question 26)
For which of these situations would you use a sequence diagram?
- To show the relationship between classes
- To show all of the different processes of your program.
- To show the different modes that your program can be in.
- To show the collaborative behaviour of objects in your program.
Question 27)
Choose the correct state diagram for a car which has a state called "HasGas:"
- a)
- b)
- c)
- d)
Question 28)
Which of these elements represents a termination in a UML State diagram?
- a)
- b)
- c)
- d)
Question 29)
What is the purpose of model checking?
- To test for user-reported bugs
- To check the software for errors before release
- To verify that the technical implementation matches conceptual mockups
- To verify that the conceptual model of your software matches the customer's requirements,
Question 30)
What is an abstract data type?
- a data-centric class
- a type of data defined by the developer rather than the language.
- a data type that cannot be used directly but must be implemented as an interface
- variables that are assigned a type (i.e. integer, double) but does not yet have a value assigned
______________________________________________________________
1 Comments
i appreciate your work.. thanks for sharing this love u bro niyander
ReplyDelete