For more questions: https://diuqbank.
com | Uploader: SUPAN ROY
DaffodilInternational University
Faculty of Science & Information Technology
Departmentof Computer Science and Engineering
Midternm Examination, Spring 2025
Course Code: CSE22 1,Course Title: Object Oriented Programming
Level:2 Term:2 Batch: ALL
Time: 1.5 Hours Marks: 25
Answer ALL Questions
[The figures in the right marginindicate the full marks and corresponding
course outcomes. Al portions of each question must be answered sequentially.]
1. a) Explain how the concepts of Encapsulation, Inheritance, and 3 CO1
Polymorplhism contribute to solving real-world problems.
Provide one real-world example for each concept
demonstrating its application and benefit.
b) Consider the following UML Class Diagram representing a 7 C02
"University System" where:
Department Professor
deptid: int id: int
1.* has m 1..*
+Department(int) +Professor(int)
+display( ): void +display( ): void
1..*
Course Teach
-code: int
-credit: double
1 *
+Course(int, double)
+display( 0: void
A Department has multiple Professors.
Each Professor teaches multiple Courses.
Each Course has a Course Code and Credit Hours.
Task:
Implement the above scenario in Java by:
Defining classes Department, Professor, and Course.
Establishing appropriate association relationships between
the classes.
Implementing methods to:
Add a professor to a department.
Assign courses to aprofessor.
Display department details, including professors
and their assigned courses.
Page I of 2
For more questions: https://diuqbank.com | Uploader: SUPAN ROY
N.B. Java collection class may be used as needed or simple association]
(Pull correct implementation: 7marks, Partial correctness: 4-5 marks, Minor
issues: 2-3 marks)
2.. a) Differentiate between a class and an obËcct in Java. Provide suitable 2 CO1
Java code snippets to illustrate your answer.
8 CO2
b) Design a Library Management System where:
The Library contains multiple Books.
Each Book is associated with one Author.
The Library manages memberships for Members, who can borrow
multiple books.
Task:
Draw a UML Class Diagram covering the association relationships
between the classes Library, Book, Author, and Member.
Include attributes such as bookTitle, ISBN,authorName, and
memberlD. [assume appropriate data type]
Indicate multiplicities for associations. [e.g. 1to many orl to l etc]
(Full correct implementation: 8marks, Partial correctness: 5-6 marks, Minor
issues: 3-4 marks)
3. Problem Solving (Analysis & Synthesis Level) 5 CO2
Problem Scenario:
You are tasked with designing a system for an Online Shopping Platform.
The platforin includes:
A Customer who can place multiple Orders.
Each Order contains multiple Products.
Each Product has a productID, productName, and price.
The Customer has details such as CustomerID, name, and address.
Task:
Analyze the problem specification.
Design a UML Class Diagram to represent the systenm, ensuring
correct association relationships between classes.
Explain the multiplicity in associations and how the Encapsulation
principle can be applied in this context.
Good Luck