For more questions: https://diuqbank.
com | Uploader: SUPAN ROY
DaffodilInternationalUniversity
Faculty of Science & InformationTechnology
Departmentof ComputerScience and Engineering
Midternm Examination, Spring 2025
Course Code: CSE221,Course Title: Object Oriented Programming
Level:2 Term:2 Batch: ALL
Time: 1.5 Hours Marks: 25
AnswerALL Questions
[Thefiguresin the right marginindicatethe fullmarks and corresponding
courseoutcomes.Al portions of eachquestionmustbe answeredsequentially.]
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
demonstratingits applicationand benefit.
b) Consider the following UML Class Diagram representing a 7 C02
"UniversitySystem" 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 Departmenthas multiple Professors.
Each Professorteaches multiple Courses.
Each Course has a Course Code and Credit Hours.
Task:
Implementthe above scenario in Java by:
Definingclasses Department,Professor,and Course.
Establishingappropriateassociationrelationshipsbetween
the classes.
Implementingmethods to:
Add a professorto a department.
Assign courses to aprofessor.
Display departmentdetails, including professors
and their assignedcourses.
Page I of 2
For more questions: https://diuqbank.com | Uploader: SUPAN ROY
N.B. Java collectionclass may be used as needed or simple association]
(Pull correctimplementation:7marks, Partialcorrectness:4-5 marks, Minor
issues: 2-3 marks)
2.. a) Differentiatebetween a class and an obËcct in Java.Provide suitable 2 CO1
Java code snippetsto illustrateyour answer.
8 CO2
b) Design a Library ManagementSystem where:
The Library contains multiple Books.
Each Book is associated with one Author.
The Library manages membershipsfor Members,who can borrow
multiple books.
Task:
Draw a UML Class Diagram coveringthe associationrelationships
between the classes Library, Book, Author, and Member.
Include attributessuch as bookTitle, ISBN,authorName,and
memberlD. [assume appropriatedata type]
Indicate multiplicitiesfor associations.[e.g. 1to many orl to l etc]
(Full correctimplementation: 8marks, Partialcorrectness:5-6 marks, Minor
issues: 3-4 marks)
3. Problem Solving (Analysis& SynthesisLevel) 5 CO2
Problem Scenario:
You are tasked with designinga system for an Online ShoppingPlatform.
The platforin includes:
A Customerwho can place multiple Orders.
Each Order containsmultiple 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 associationrelationshipsbetween classes.
Explain the multiplicityin associationsand how the Encapsulation
principlecan be applied in thiscontext.
Good Luck