Recall & Review
beginner
What is a class diagram in software engineering?A class diagram is a visual representation that shows the structure of a system by displaying its classes, their attributes, methods, and the relationships between them.Click to reveal answer
beginner
Name the three main parts of a class box in a class diagram.The three main parts are: 1) Class name at the top, 2) Attributes (properties) in the middle, 3) Methods (functions) at the bottom.Click to reveal answer
beginner
What does an association relationship represent in a class diagram?An association shows a connection or link between two classes, indicating that objects of one class use or communicate with objects of another class.Click to reveal answer
intermediate
Explain the difference between inheritance and composition in class diagrams.Inheritance means one class (child) inherits attributes and methods from another class (parent), showing an 'is-a' relationship. Composition means one class contains another class as a part, showing a 'has-a' relationship where the part cannot exist independently of the whole.Click to reveal answer
beginner
Why are class diagrams useful in software development?Class diagrams help developers understand and plan the system's structure clearly. They make it easier to communicate ideas, design the system, and find errors early before coding.Click to reveal answer
Which part of a class diagram shows the functions a class can perform?
✗ Incorrect
The methods section lists the functions or operations that a class can perform.
What type of relationship in a class diagram represents 'is-a'?
✗ Incorrect
Inheritance shows an 'is-a' relationship where a child class inherits from a parent class.
In a class diagram, what does a solid diamond at one end of a line represent?
✗ Incorrect
A solid diamond indicates composition, meaning a strong 'has-a' relationship where the part cannot exist without the whole.
Which of the following is NOT typically shown in a class diagram?
✗ Incorrect
Class diagrams show structure, not behavior or state changes over time, which are shown in other diagrams like state diagrams.
What does an open arrowhead on a line between classes usually indicate?
✗ Incorrect
An open arrowhead points to the parent class in an inheritance relationship.
Describe the main components of a class diagram and explain their purpose.
Think about how a class is shown and what information it holds.
You got /5 concepts.
Explain how inheritance and composition differ in class diagrams and give a real-life example for each.
Consider 'is-a' vs 'has-a' relationships.
You got /4 concepts.