0% found this document useful (0 votes)
4 views2 pages

Object Oriented Programming Spring 25 Midterm

The document outlines a midterm examination for the course CSE221: Object Oriented Programming at Daffodil International University. It includes questions on concepts like Encapsulation, Inheritance, and Polymorphism, as well as tasks involving UML Class Diagrams and Java implementation for various systems such as a University System and a Library Management System. Additionally, it presents a problem scenario for designing an Online Shopping Platform with specific requirements for class relationships and attributes.

Uploaded by

Sadman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Object Oriented Programming Spring 25 Midterm

The document outlines a midterm examination for the course CSE221: Object Oriented Programming at Daffodil International University. It includes questions on concepts like Encapsulation, Inheritance, and Polymorphism, as well as tasks involving UML Class Diagrams and Java implementation for various systems such as a University System and a Library Management System. Additionally, it presents a problem scenario for designing an Online Shopping Platform with specific requirements for class relationships and attributes.

Uploaded by

Sadman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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

You might also like