Java Programming Problem Statements
1. Ride Sharing Application
Develop a Java application for a ride-sharing service similar to Uber.
The system should manage different ride types such as Bike Ride, Auto Ride, and Cab Ride.
Create an abstract class Ride containing common details like:
• Customer name
• Distance traveled
• Base fare
Include an abstract method:
calculateFare()
Create subclasses:
• BikeRide
• AutoRide
• CabRide
Each subclass should calculate fare differently based on distance.
Use runtime polymorphism to display ride details and total fare for multiple customers.
Expected Output:
----- Ride Details -----
Customer Name : Rahul
Ride Type : Bike Ride
Distance : 5 km
Total Fare : ■50
Customer Name : Amit
Ride Type : Auto Ride
Distance : 8 km
Total Fare : ■120
Customer Name : Sneha
Ride Type : Cab Ride
Distance : 12 km
Total Fare : ■240
2. Smart Home Automation System
Develop a Smart Home Automation System in Java to control devices such as:
• Fan
• Light
• Air Conditioner
Create an interface SmartDevice.
Include methods:
• turnOn()
• turnOff()
Create classes:
• Fan
• Light
• AC
Each class should implement the interface methods differently.
Use polymorphism to control all smart devices using a single interface reference.
Display the status of each device after performing operations.
Expected Output:
----- Smart Home Control -----
Fan is ON
Fan is OFF
Light is ON
Light is OFF
AC is ON
AC is OFF
3. Weather Monitoring Application
Develop a Java application for monitoring weather temperature data.
The system should:
• Store daily temperature readings in an array
• Calculate average temperature
• Find highest temperature
• Find lowest temperature
Create a class WeatherReport containing:
• Temperature array
• Methods for calculations and display
Use loops and operators to perform calculations on the temperature data.
Display the complete weather analysis report for one week.
Expected Output:
----- Weather Report -----
Temperature Readings:
32 35 30 28 36 31 33
Average Temperature : 32.1°C
Highest Temperature : 36°C
Lowest Temperature : 28°C