A command-line application for managing student grades and academic records, with support for statistical analysis and persistent data storage.
- Name: WANGODA FRANCIS
- Student Number: 2400711855
- Registration Number: 24/U/11855/PS
- Add and remove students with unique administrative numbers
- Record and edit grades for multiple subjects (Maths, SST, English, Science)
- View individual student grades and academic progress
- Generate comprehensive statistical analysis including:
- Average scores per subject
- Maximum and minimum grades
- Mode and frequency analysis
- Save data persistently using JSON format
- Simple and intuitive command-line interface
- Input validation for grades (0-100 range)
- Clear error handling and user feedback
GRADE_BOOK/
- Purpose: Manages individual student data
- Attributes:
admin_no
: Unique identifiername
: Student's full namemarks
: Dictionary of subject marks
- Methods:
__init__(admin_no, name)
: Initialize studentset_marks(subject, marks)
: Set subject marksget_marks(subject)
: Retrieve marksedit_marks(subject, new_marks)
: Modify marks
- Purpose: Manages entire gradebook system
- Attributes:
filename
: JSON storage locationstudents
: Dictionary of Student objects
- Methods:
__init__(filename)
: Initialize gradebookload_data()
: Load from JSONsave_data()
: Save to JSONadd_student(student)
: Add new studentget_student(admin_no)
: Retrieve studentdelete_student(admin_no)
: Remove studentview_statistics()
: Calculate statisticsview_student_grades(admin_no)
: View gradesprint_gradebook()
: System summary
The application uses JSON format for data persistence. The data is stored in previous_data.json
with the following structure:
-
Root Level
- Key: Student's administrative number (string)
- Value: Object containing student details
-
Student Object
name
: Student's full name (string)marks
: Object containing subject marks
-
Marks Object
Maths
: Mathematics score (integer: 0-100)SST
: Social Studies score (integer: 0-100)English
: English score (integer: 0-100)Science
: Science score (integer: 0-100)
- Admin numbers must be unique
- Marks must be between 0 and 100
- All subject marks are required
- Names cannot be empty
-
Reading Data
- Loads on program startup
- Converts JSON to Student objects
- Handles missing file errors
-
Writing Data
- Saves after every modification
- Converts Student objects to JSON
- Maintains data persistence
-
Data Security
- Backup creation recommended
- File permissions should be set appropriately
- Error handling for file operations
The generate_data.py
script creates sample records following this structure:
- Creates 200 random student records
- Generates realistic names
- Assigns random marks between 40-100
- Maintains data structure integrity