Object Oriented Programming
CSE · Midterm · Fall 23
Section All · Batch 63
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 CSE
Midterm Examination, Semester: Fall 2023
Course Code: CSE214
Course Title: Object Oriented Programming
Batch: 63
Section: All
Time: 01:30H
[Answer all the Questions. Obtain marks in the right side]
Full marks: 25
1. a. Explain the fundamental paradigm difference between structured programming and Object-Oriented Programming
1. b. Inheritance in Java is undeniably useful as it aids in code reuse and reducing complexity. However, is multiple inheritance supported in Java? Explain your answer.
1. c. Describe Interface is different from abstract Class?
2. a. [Figure: Three mathematical figures showing AB, pi*r^2, and ABC]. Create a Class AREA and find out the area of these three figures using Method Overloading.
2. b. Is there any error in the following code. If 'yes', provide the correction. If 'no' what will be the output of this program?
1 public class University {
2 public static void main(String[] args) {
3 Daffodil diu = new Department();
4 diu.display();
5 }
6 }
7
8 class Daffodil {
9 void display() {
10 System.out.println("Daffodil International University");
11 }
12 }
13
14 class Department extends Daffodil {
15 void display() {
16 System.out.println("Computer Science & Engineering");
17 }
18 }
3. Online Banking System
Consider an Online Banking system, which consists of customers. The Customer is composed of Savings and Checking accounts, both of which are a type of Account. Each account has a unique account number, account balance, and account type (savings or checking). Customers also have unique customer IDs, names, addresses, and phone numbers. Customers can deposit and withdraw money from their accounts. Savings accounts earn an annual interest rate of 3%, while Checking accounts have no interest. Implement the necessary classes and methods for this online banking system.
N.B. You are allowed to necessary assumptions for return type, modifiers and parameters of services
3. a. Design UML class diagram that represents the above scenario.
3. b. Write a Java code to implement your proposed UML's.