Java – Tasks
1. Package + Array – Student Percentage Calculator
Question:
Create a package school with a Student class containing rollNo, name, and
marks array. Accept marks for 5 subjects and calculate percentage using a
method.
Expected Output:
Student: Kiran
Marks: [75, 80, 85, 70, 90]
Percentage: 80.0%
2. Package + ArrayList – Departmental Budget Tracker
Question:
Create a package organization with class Department. Use ArrayList to store
monthly expenses. Write methods to calculate total and average expenses.
Expected Output:
Department: HR
Monthly Expenses: [12000, 15000, 13000]
Total: 40000
Average: 13333.33
Or
Package + ArrayList – Library System
Question:
Create package library with a class Book (id, title, author). Use ArrayList to
manage book inventory. Allow add/search/delete options.
Expected Output:
Books:
1. Java Made Easy by Sharma
2. Clean Code by Martin
3. Package + Array – Cricket Scorecard
Question:
Create package sports with class Player (name, runs[]). Calculate total runs
and average using array operations.
Expected Output:
Player: Dhoni
Scores: [45, 78, 67]
Total: 190
Average: 63.33
4. Package + ArrayList – Attendance Tracker
Question:
Create a package classroom with class AttendanceRecord. Track daily
attendance for a student in ArrayList. Count present and absent days.
Expected Output:
Attendance: [P, A, P, P, A]
Present: 3, Absent: 2
5. Package + Array – Online Order Billing
Question:
In package ecommerce, define class Order with price and quantity fields.
Accept multiple orders and compute final amount with tax.
Expected Output:
Order Total (before tax): 1500
Tax: 5%
Final Amount: 1575
Or
Package + ArrayList – Train Reservation System
Question:
Create package railways with class Reservation. Store multiple reservations
in ArrayList. Display reserved seat numbers in sorted order.
Expected Output:
Seats Booked: [21, 5, 17]
Sorted: [5, 17, 21]