Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 1.42 KB

File metadata and controls

24 lines (15 loc) · 1.42 KB

🎓 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.

🧠 Core OOP Concepts Demonstrated

  • Encapsulation: The score variable is kept private within the Grader class, accessible only through a controlled constructor. [cite: 221]
  • Constructors: Uses a parameterized constructor to initialize the state of the Grader object 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]

✨ Features

  • Input Validation: The main driver program checks that the user's input is strictly between 0 and 100 before ever creating the Grader object. [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.

🚀 How to Compile and Run

To run this program, ensure you have the Java Development Kit (JDK) installed.

  1. Open your terminal or command prompt.
  2. Navigate to the directory containing the file.
  3. Compile the Java code: