Skip to content

Object Oriented Concepts Lab

ITM · Lab 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 Information Technology & Management Final Examination, Summer 2025 Course Code: ITM214; Course Title: Object Oriented Concepts Sections & Teachers: A, MA Base Class: Vehicle • Attributes: o license_plate (protected) o vehicle_type (public) o base_rate (private) • Constructor: Initialize all attributes. • Methods: o displayDetails(): Prints license plate, vehicle type, base rate. o calculateRentalCost() (Method Overloading): ■ If only days is provided -> total = days * base_rate. ■ If both days and discount are provided -> total = (days * base_rate) - discount%. ♦ Derived Class: LuxuryVehicle (inherits from Vehicle) • Additional Attributes: o has_chauffeur (boolean) o luxury_features (list, e.g., "Leather Seats", "Premium Audio") • Constructor: Use constructor chaining for initialization. • Method Overriding: o displayDetails(): Show vehicle details + chauffeur info + luxury features. o calculateRentalCost(days, discount=0): Before applying calculation, add an extra 20% luxury fee to base_rate, then proceed with the overloaded logic. ♦ Task for Students: 1. Create a LuxuryVehicle object with: License Plate: DHA-2025, Base Rate: $80/day, Chauffeur: Yes, Features: ["Leather Seats", "Premium Audio"]. 2. Call displayDetails() to print details. 3. Call calculateRentalCost(5, 10) to compute cost for 5 days with 10% discount.