Tasks
-
Student Grade Evaluation Task: Create a Student class with fields: name, marks, and subject. In the main method: Create a Student object. Check if the student has passed or failed the subject (passing marks >= 40) and print the result.
-
Vehicle Fuel Efficiency Task: Create a Vehicle class with fields: model, mileage, and fuelCapacity. In the main method: Create a Vehicle object. Calculate how far the vehicle can travel (mileage * fuelCapacity) and print the result. Explanation: This reinforces using object fields for calculations.
-
Product Discount Calculation Task: Create a Product class with fields: name, price, and discountPercentage. In the main method: Create a Product object. Calculate the discounted price and print the result.
-
Bank Account Balance Update Task: Create a BankAccount class with fields: accountHolderName and balance. In the main method: Create a BankAccount object. Deposit an amount into the account and print the updated balance. Explanation: This introduces updating object fields and performing logical operations.
-
Create a POJO class Employee with fields: empId, name, basicSalary, hra, and da. Store details of 5 employees using an array of objects. Perform the following operations: Calculate the gross salary for each employee (gross = basic + hra + da). Find and display the employee with the maximum salary. Print the details of employees whose salary is greater than the average salary of all employees. Explanation: This covers aggregation + comparison + filtering. You’ll work with numerical calculations and finding max/average values.