A student records system
The problem
Build a console program that manages students, courses and marks: enrolment, marks entry, transcripts, averages and rankings, with every rule enforced and every error reported clearly.
Requirements
- Records or classes for Student, Course and Mark, with private state and validation
- Maps for lookups by id and lists for each student's marks
- Custom exceptions for unknown ids, duplicate enrolment and invalid marks
- Reports built with streams: averages per course, top students, students below a threshold
Technologies
- Java 17
- Records and classes
- Collections
- Exceptions
- Streams
Step by step
- List the nouns and verbs of the problem and turn them into classes and methods.
- Write the domain classes with their validation, and test each method with small cases.
- Add a service class that holds the maps and enforces the rules.
- Write the command loop in main and the stream-based reports.
Expected result
A reliable console application where invalid commands are reported and never corrupt the data.
How it is evaluated
- Every rule is enforced inside the classes
- Reports match hand-calculated results
- Errors give clear messages
- Code is split into small methods and classes
Ways to improve it
- Save and load data from a CSV file
- Add unit tests with JUnit
- Add a GPA calculation with weighted credits