Due Date


OOP Concepts

Overview

This program demonstrates Object-Oriented Programming (OOP) concepts such as class creation, inheritance, constructors, and method overriding. The program consists of a Mobile class and three subclasses, Android, iPhone, and BlackBerry.

Make sure to follow the Single Responsibility Principle and break each class into its own file.

Step 1: Create the Mobile Class

Step 2: Create the Android Subclass

Step 3: Create the iPhone Subclass

Step 4: Create the BlackBerry Subclass

Step 5: Create the Main Class

Polymorphic Method

Enhance the program by creating a polymorphic method getDiscountedPrice() in the Mobile class that calculates a discount based on the device type. Override this method in the Android, iPhone, and BlackBerry subclasses to apply different discount rates. Test this method in the Main class by calling it polymorphically.

Expected Output

Manufacturer: Generic, OS: OS, Model: Basic Model, Cost: $500.0
Discounted Price: $475.0

Manufacturer: Samsung, OS: Android, Model: Galaxy S21, Cost: $1000.0 (Android Details)
Discounted Price: $900.0

Manufacturer: Apple, OS: iOS, Model: iPhone 13, Cost: $1200.0 (iPhone Details)
Discounted Price: $1080.0

Manufacturer: BlackBerry, OS: BB OS, Model: BlackBerry Key2, Cost: $800.0 (BlackBerry Details)
Discounted Price: $680.0