Object Oriented Design
SWE · Midterm · Spring 25
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 Software Engineering
Midterm Examination, Spring 2025
Course Code: SE221; Course Title: Object Oriented Design
Sections & Teachers: [A-D]AG, [E-H,M]MBH, [I-L]MIM, [N]NML
Time: 1 Hour 30 Mins
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.]
Q1.
Let, the COO of "Uthao Ride" service came to you to develop their ride sharing application. In the service, They are planning to create some features for all the users who are going to use the application in future. The features are pickUp, dropOff, findRider, chooseVehicle and payment. The COO does not want to finalize the working of the processes right now.
After 3 months, a new COO of the same company came to you with the demand that the pickUp and dropOff methods will work differently for normalUser and premiumUser. The user who occasionally uses the application will have to make payment the VAT with the fare while paying and on the other hand, premium users payment would be VAT free. Premium users may choose to be dropped off at any location which is 50 meters from the chosen dropOff location. Also both premium and diamond users will get the opportunity to choose vehicle and speed while choosing the vehicle.
a) According to the above description, Construct proper working code segments together. Must build the Main method in a different class and inside the main method, make the object of each class.
[CLO 1, L3]
8 Marks
b) 2 Marks
class A{
int x = 10;
}
class B extends A{
int x = 20;
}
public class Test{
public static void main(String args[]){
A a = new B();
B b = new A();
System.out.println(a.x);
System.out.println(b.x);
}
}
Trace the output of the above code and show the output.
[CLO 1, L4]
2 Marks
Q2.
A university has recently decided to digitize its course management system to streamline student enrollment, grading, and administrative processes. Currently, students must manually register for courses, and payments are handled separately by the finance department, causing frequent delays. Professors also struggle with managing student enrollments, tracking assignments, and assigning grades efficiently. The university wants an online system where different users can perform tasks based on their roles. Students should be able to enroll in courses, access their schedules, submit assignments, and check their grades, while tuition payments must be processed through an external service before enrollment is finalized. Professors will need to manage course materials, track student submissions, and assign grades based on completed work. Administrators will oversee user roles, maintain course catalogs, and ensure the system runs smoothly. The system must handle role-based access so that each user interacts only with the relevant features. Course enrollment should be linked to payment verification, ensuring students can only finalize registration after a successful transaction. Professors should only be able to assign grades if students have submitted their work, and administrators must be able to generate reports for system-wide monitoring. The university is looking for a well-structured, automated solution that connects these different functions seamlessly.
Consider the above scenario and picture a complete use case diagram with standard notations. Please remember, you can not disclose the data of one end to another
[CLO 2, L2]
10 Marks
Q3. Answer the short questions
Discuss how static variables and methods work in java. Explain with code in details
[CLO 3, L2]
3 Marks
a) string s = 5;
b) int x = 7/0;
Visualize from the above lines, which one occurs runtime error and which one compile time error. Also explain why.
[CLO 3, L2]
2 Marks