Skip to content

Object Oriented Programming

CSE · Midterm · Fall 24

Section All · Batch 64

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 and Information Technology Department of Computer Science & Engineering Midterm Examination, Semester: Fall 2024 Course Code: CSE221 Course Title: Object Oriented Programming Level_Term: L2_T2 Batch: 64 Section: All Time: 1.5 Hours Marks: 25 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. Consider the following UML notation of a Class: [Figure: UML class diagram for Customer with fields custid: int, name: String, category: String, and methods Customer(int, String), display(): void, main(String[]): void, setCat(String): void, getCat(): String] Answer the following questions: a. Write the implementation of the above UML using Java language. Inside the main method, create an object and show calling of all the methods with expected output of the call. [10] b. Write briefly how an instance method is different from a class method from the above UML class notation. [3] c. What are the advantages of the class method? [2] 2. Consider the following requirement specification for creating an OO model: Agora is a Shop and every shop has email of type String. Agora has location of type String, Agora sale Item and every item has unitPrice of type double, Book is an Item and it has isbnNumber of type integer. a. Create an object oriented model through analysis of the above requirements using UML notation. Clearly mark all relationships. [5] b. Implement the above model using Java language. [5]