GradeForge is a Python CLI-based application for managing student grades. It uses Object-Oriented Programming principles to model students, subjects, and grades, supporting different logic for High School and College students.
- Student Management:
- Add new students (Generic, High School, or College types).
Studentclass stores name, ID.HighSchoolStudentandCollegeStudentinherit fromStudentwith specific grading logic.CollegeStudentincludes amajorattribute.
- Subject Management:
- Define subjects with a name, code, and credit hours.
- Assign subjects to students. Each student enrollment gets a distinct instance of the subject.
Subjectclass stores name, code, credit hours, and a list of grades.
- Grade Management:
- Input grades for each subject per student.
Gradeclass stores description (e.g., "Midterm"), a numeric score/point, and an optional letter grade.- High School Students:
- Numeric marks (0-100).
- Pass/fail based on a 50% overall average.
- College Students:
- Letter grades (
A+,A,A-, ...,F). - Grade points assigned to letter grades (e.g., A/A+ = 4.0, F = 0.0).
- GPA calculation based on grade points and subject credit hours.
- Failing a course is indicated by an 'F' grade. Academic status considers GPA and F grades.
- Letter grades (
- Reporting:
- Calculate and display subject-wise performance.
- Calculate overall average (for High School) or GPA (for College).
- Determine pass/fail status or academic standing.
- Generate detailed individual student reports.
- Data Persistence:
- Save current session data (students, subjects, grades) to a JSON file (
gradeforge_data.json). - Load data from the JSON file upon application startup.
- Save current session data (students, subjects, grades) to a JSON file (
- Data Export:
- Export all student data to a CSV file.
- CLI Interface:
- Interactive menu-driven command-line interface.
The project is organized into the following Python files:
gradeforge.py: Main application file containing the CLI logic, data management (GradeForgeclass), and interactions between different components.student.py: Defines the baseStudentclass and derived classesHighSchoolStudentandCollegeStudent. Includes logic for grade calculations specific to student types (overall average, GPA, pass/fail status).subject.py: Defines theSubjectclass, which stores subject details (name, code, credit hours) and a list of associatedGradeobjects. It can calculate the average score/point for the subject.grade.py: Defines theGradeclass, representing an individual grade entry with a description, score (numeric mark or grade point), and an optional letter grade.README.md: This file, providing an overview of the project.gradeforge_data.json: (Generated at runtime) Stores the application data.*.csv: (Generated by export feature) CSV exports of grade data.
Grade: Represents a single assessment outcome.Subject: Represents a course, containing multipleGradeobjects and credit hour information.Student: Base class for students. Manages a collection ofSubjectobjects they are enrolled in.HighSchoolStudent(inheritsStudent): Implements grading logic based on numeric marks and a simple average.CollegeStudent(inheritsStudent): Implements grading logic based on letter grades, grade points, credit hours, and GPA.
GradeForge: Orchestrator class that manages collections ofStudentand templateSubjectobjects, handles user interaction via the CLI, and manages data persistence and export.
Polymorphism is utilized, for example, in generate_report() and get_overall_average() methods, where the behavior adapts based on whether the object is a HighSchoolStudent or CollegeStudent.
- Ensure you have Python 3 installed.
- Save all the Python files (
gradeforge.py,student.py,subject.py,grade.py) in the same directory. - Open a terminal or command prompt in that directory.
- Run the application using the command:
python gradeforge.py
- Follow the on-screen menu options to interact with the system.
No external libraries are required beyond standard Python libraries (json, csv, os).