A small, console-based gradebook management system that lets you maintain a class roster, record assessment scores, and generate both individual student reports and class-level summaries.
From an industry perspective, this project practices what real software teams care about early: input validation, consistent data representation, reporting, and maintaining state across user operations—all common in admin tools, internal dashboards, and CRUD-style systems.
The application stores up to 50 students, each with up to 8 assessments. Through a menu-driven interface, you can:
- Add a new student (ID, name, and assessment scores)
- Update a student’s score for a chosen assessment
- Generate an individual student report (total, min, max, average, letter grade, pass/fail)
- Generate a class summary (class average, highest/lowest average, pass rate)
- Show a performance ranking (sorted by average, highest → lowest)
- List all student records (ID, name, average, grade)
- Delete a student record (and shift the arrays to close the gap)
These constants control program limits:
MAX_STUDENT = 50→ maximum number of students in memoryMAX_TESTS = 8→ maximum number of assessments per studentID_LEN = 11→ max characters for stored IDs (including null terminator)NAME_LEN = 32→ max characters for stored names (including null terminator)
A student ID must start with ets or ETS.
The program normalizes IDs to lowercase for consistent lookups.
The program uses fixed-size arrays:
char ids[MAX_STUDENT][ID_LEN]char names[MAX_STUDENT][NAME_LEN]double marks[MAX_STUDENT][MAX_TESTS]int studentCount
This is a classic “static table” approach: fast, predictable, and simple.
In real systems, you’d often replace this with std::vector, structs/classes, and persistent storage (files/DB). But for learning and for small tools, this is a solid way to practice correctness, boundaries, and indexing discipline.
When you run the program, it asks:
- Number of assessments per student (1–8)
Then it loops over this menu:
1)Add a student record2)Update a student's assessment score3)Generate an individual student report4)Generate class summary and performance ranking5)Display all student records6)Delete a student record0)Exit
The program computes:
- Total = sum of assessment marks
- Average = total / number of assessments
- Min/Max marks across assessments
- Letter grade from the average:
| Average | Grade |
|---|---|
| > 90 | A+ |
| ≥ 85 | A |
| ≥ 80 | A- |
| ≥ 75 | B+ |
| ≥ 70 | B |
| ≥ 65 | B- |
| ≥ 60 | C+ |
| ≥ 50 | C- |
| < 50 | F |
Pass/Fail: Pass if average ≥ 50.
This project emphasizes robust console input handling:
readNum()repeats until a valid number is enteredreadNumRange()enforces numeric bounds (e.g., 0–100)readName()andreadId()enforce maximum length and required formatclearBadInput()resetscinafter bad input to prevent infinite failure loops
This is exactly the kind of defensive programming that prevents “works on my machine” bugs in production tools.
From the project folder:
g++ -std=c++17 -O2 -Wall -Wextra -pedantic main.cpp -o gradebook
.\gradebook.exe
If your file isn’t named
main.cpp, replace it with your actual filename.
If using the Developer Command Prompt for VS:
cl /EHsc /std:c++17 main.cpp
main.exe
- Choose number of assessments (e.g., 4)
- Add students (ID, name, scores)
- List students to verify data
- Generate student reports or class summary/ranking
- Update marks if needed
- Delete a student if they drop the course
If you continue this project (good portfolio upgrade), here are high-value steps:
- Replace parallel arrays with a
struct Student { id, name, vector<double> marks; } - Use
std::vector<Student>instead of fixed-size arrays - Persist data to a file (CSV/JSON) so the gradebook survives program exit
- Improve ID rules (length, allowed characters) and ensure uniqueness reliably
These are the same refactors you’d do in industry when a prototype becomes a maintained tool.
This project is intended for educational use in learning C++ fundamentals and basic software engineering practices (validation, reporting, and stateful CRUD operations).