Skip to content

Object Oriented Programming

CSE · Final · Summer 25

This browser can’t show the PDF here

Open it, and your phone’s PDF viewer takes it, or download it.

Read the questions as text

Read off the PDF by AI, so it may have mistakes. The PDF is the original.

Daffodil International University Faculty of Science & Information Technology Department of Computer Science & Engineering Final Examination, Summer 2025 Course Code: CSE221, Course Title: Object Oriented Programming Level: 2 Term: 2 Time: 02:00 Hrs Marks: 40 Answer ALL Questions [The figures in the right margin indicate the full marks and corresponding course outcomes. All portions of each question must be answered sequentially.] 1. "Online Payment System": An abstract class Payment defines a method processPayment() and stores amount. Two types of payments are supported: - CreditCardPayment: Requires cardNumber, cardHolderName. - MobilePayment: Requires mobileNumber, provider. Each payment type calculates charges differently. The system processes payments through a common interface but calculates and displays charge details based on payment type. a) Design a UML class diagram for the system including: - Abstract class and its attributes/methods - Inheritance hierarchy - Method overriding and data members - Association (if any) Marks: 10, CO: CO3 b) Write Java code for: - Abstract class Payment with processPayment() - CreditCardPayment and MobilePayment overriding processPayment() - A main() method that demonstrates polymorphism using an array or list of Payment objects and processes each payment. Marks: 12, CO: CO2 c) Justify why polymorphism is appropriate in this design. Explain how adding a new payment method in future would benefit from this design. Marks: 03, CO: CO2 2. "E-Learning Platform": An e-learning platform offers courses, each having multiple modules. A course has courseTitle and courseCode. Each Module has moduleTitle and duration. Each student can enroll in multiple courses, and for each course, students complete different modules. a) Analyze the business case and design a UML class diagram showing: - Proper class identification - Attributes with types - Relationships (use association and multiplicity) - Clear modeling of Student-Course-Module structure Marks: 10, CO: CO3 b) Discuss two important UML modeling decisions you made in Q2(a). For example: Why you used aggregation vs. composition, how multiplicity was determined, or how the enrollment relationship was modeled. Marks: 05, CO: CO3