Skip to content

Conversation

@ZohaiAli
Copy link

Summary

This update improves the structure and readability of the grade tracking program. The goal was to make the code cleaner, more modular, and more reliable while keeping all original functionality intact.

Changes Made

  • Refactored functions for clarity and maintainability
  • Added input validation to prevent crashes from invalid or non-numeric grades
  • Improved menu flow and error handling
  • Added confirmation step when removing a student
  • Enhanced print/output formatting for better user experience
  • Simplified main loop to avoid repetitive code

Why This Matters

The previous version worked but was difficult to maintain, lacked validation, and mixed logic with user I/O. This refactor keeps the same behavior but improves code quality and usability, making future changes safer and faster.

Testing

  • All main features (add, remove, average) tested manually in terminal
  • Invalid input cases tested (non-numeric grades, unknown students, etc.)
  • Verified no regressions or broken functionality

Next Steps (optional)

  • Add file-based persistence (save/load student data)
  • Add a feature to register new students interactively
  • Possibly include basic unit tests for main functions

### Summary
This update improves the structure and readability of the grade tracking program. 
The goal was to make the code cleaner, more modular, and more reliable while keeping all original functionality intact.

### Changes Made
- Refactored functions for clarity and maintainability
- Added input validation to prevent crashes from invalid or non-numeric grades
- Improved menu flow and error handling
- Added confirmation step when removing a student
- Enhanced print/output formatting for better user experience
- Simplified main loop to avoid repetitive code

### Why This Matters
The previous version worked but was difficult to maintain, lacked validation, and mixed logic with user I/O. 
This refactor keeps the same behavior but improves code quality and usability, making future changes safer and faster.

### Testing
- All main features (add, remove, average) tested manually in terminal
- Invalid input cases tested (non-numeric grades, unknown students, etc.)
- Verified no regressions or broken functionality

### Next Steps (optional)
- Add file-based persistence (save/load student data)
- Add a feature to register new students interactively
- Possibly include basic unit tests for main functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant