Object Oriented Programming
SWE · Lab Midterm · Summer 26 · 3 views
Paper 2 of 2By Md. Mehedi Hasan 251-35-322 (2)Switch
shared by Md. Mehedi Hasan 251-35-322
Paper 2 of 2Read 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
Course Code: SE 217; Course Title: Object Oriented Programming Lab
Lab Evaluation Instructions
• Write the Java code in your IDE (e.g., IntelliJ IDEA, Eclipse, or NetBeans).
• Compile and run the program.
• Take clear screenshots of:
◦ The complete Java source code.
◦ The program output.
• Paste both screenshots into the Word document and make it pdf.
• Save the document using the format: StudentID(Last 3 digit)_Name.pdf. [211_Mehedi.pdf]
• Upload the pdf to BLC before the submission deadline
Question 3: A fitness center offers two membership plans: Gold Membership and Platinum Membership. Every member has a Member ID(1st id will be your ID), Member Name(1st name will be your name), and Monthly Fee. The total membership fee is calculated differently for each membership plan.
Gold members receive personal training services, while Platinum members receive both personal training and diet consultation services.
Design and implement the application according to the following requirements.
1. Create an abstract class Membership containing the necessary attributes, a parameterized constructor, an abstract method calculateMembershipFee(), and a concrete method displayMemberInfo().
2. Create the following interfaces:
◦ PersonalTraining
▪ scheduleTraining()
▪ displayTrainerDetails()
◦ DietConsultation
▪ bookConsultation()
▪ displayDietPlan()
3. Create the following classes:
◦ GoldMembership
◦ PlatinumMembership
4. GoldMembership must extend the abstract class and implement the PersonalTraining interface.
5. PlatinumMembership must extend the abstract class and implement both PersonalTraining and DietConsultation interfaces.
6. Override the abstract method to calculate the total membership fee according to your own business logic.
7. In the main() method:
◦ Create one object of each membership type.
◦ Display the output in a neat format.