🎓 Student Grader System
Course: Object-Oriented Programming in JAVA Lab (BCA39109) | Instructor: Debmalya Mukherjee (Assistant Professor, Computational Sciences Department) [cite: 9, 10]
This project implements a simple grading system. It demonstrates the use of class encapsulation, constructors, and input validation to convert a numerical score into a standard letter grade.
- Encapsulation: The
scorevariable is kept private within theGraderclass, accessible only through a controlled constructor. [cite: 221] - Constructors: Uses a parameterized constructor to initialize the state of the
Graderobject with the user's score. [cite: 222, 233] - Method Implementation: Includes a specific
letterGrade()method that handles the conditional logic to return the correct grade (O, E, A, B, C, or F). [cite: 243]
- Input Validation: The main driver program checks that the user's input is strictly between 0 and 100 before ever creating the
Graderobject. [cite: 229, 230, 231] - Safe Scanner Usage: Includes a helper method to ensure the program doesn't crash if a user accidentally types letters instead of numbers.
To run this program, ensure you have the Java Development Kit (JDK) installed.
- Open your terminal or command prompt.
- Navigate to the directory containing the file.
- Compile the Java code: