Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Student Records Management System (C++)

A Windows-oriented console application for managing student records through a simple, menu-driven interface. The system supports creating, editing, deleting, searching, and displaying student records while calculating total marks and average grades automatically.

Project status: This repository contains the original C++ source code and a pre-built Windows executable. The application is suitable for learning, coursework, and small local record-management scenarios.

Overview

The application stores student records in a text file and loads the available records when it starts. Any changes made through the application are written back to the storage file automatically.

The current implementation is designed primarily for Windows because it uses a Windows-style data path and the cls console command. Before running the program, make sure that the configured data location is available on your machine.

Features

Capability Description
Add records Create a new student record and enter marks for six subjects.
Edit records Update the personal information, major, level, and marks of an existing record.
Delete records Remove a student record by student ID.
Search Find a record by first name or student ID.
Sort and display Display all records sorted by ID, first name, or total marks.
Automatic calculations Calculate total marks and the average grade from six subject marks.
Automatic persistence Save changes to the configured text file after add, edit, or delete operations.

Student Record Structure

Each record contains the following information:

Field Description Validation or calculation
Student ID Numeric identifier for the student. Entered by the user.
First name Student's first name. Alphabetic characters only; the current input accepts one word.
Last name Student's last name. Alphabetic characters only; the current input accepts one word.
Major Student's academic major. Must be one of IT, IS, CS, or CYS.
Level Academic level. Must be an integer from 1 to 4.
Subject marks Marks for six subjects. Each mark must be between 1 and 100.
Total marks Sum of the six subject marks. Calculated automatically.
Average grade Average of the six subject marks. Calculated automatically as total marks / 6.

Requirements

To run the included executable, use a Windows environment compatible with project.exe. To build the application from source, use a C++ compiler that supports the current source implementation and the C++ standard library.1

The application currently expects its data file at:

D:/students.txt

If the D: drive does not exist, either create the required location or change the path in the load() and save_in_file() functions in project.cpp before compiling.

Getting Started

1. Clone the repository

git clone https://github.com/IBR4NX/student-records-cpp.git
cd student-records-cpp

2. Prepare the data file

Create an empty file named students.txt inside the root of the D: drive:

D:/students.txt

The application reads existing records from this file when it starts. If the file is not accessible, loading and saving records may fail.

3. Run the included executable

From a Windows Command Prompt or PowerShell terminal, run:

.\project.exe

4. Build from source

With a compatible GCC or MinGW-w64 toolchain, compile the source with:

g++ -std=c++17 project.cpp -o project.exe

Then run the generated executable:

.\project.exe

Compiler compatibility note: The current source uses Windows-oriented behavior such as system("cls") and a case-insensitive string comparison function. Depending on the compiler and platform, these implementation details may require small portability adjustments before the source builds successfully.1 2

Main Menu

When the program starts, it presents the following operations:

Option Operation
1 Add a new student record
2 Edit a student record
3 Delete a student record
4 Search for a student
5 Display all student records
6 Exit the application

The display menu provides three ordering options: student ID in ascending order, first name in alphabetical order, and total marks in descending order.

Data File Format

Records are stored as space-separated values. A serialized record follows this structure:

<student_id> <first_name> <last_name> <major> <level> <total_marks> <average_grade>

Example:

1001 Sara Ali CS 2 510 85

The six individual subject marks are entered by the user and used to calculate the total and average. In the current implementation, the data file stores the calculated total and average rather than the six subject marks separately.

Project Structure

student-records-cpp/
β”œβ”€β”€ project.cpp    # C++ source code
β”œβ”€β”€ project.exe    # Pre-built Windows executable
└── README.md      # Project documentation

The runtime data file is stored outside the repository at D:/students.txt unless the path is changed in the source code.

Validation Rules

The application applies the following input checks:

  • Names must contain alphabetic characters.
  • Majors must be IT, IS, CS, or CYS.
  • Academic levels must be between 1 and 4.
  • Subject marks must be between 1 and 100.
  • The in-memory record array has a maximum capacity of 100 students.

Known Limitations

The current version is intentionally simple and has several limitations that may be useful to address in future improvements:

  1. The storage path is hard-coded as D:/students.txt.
  2. The application uses a fixed-size in-memory array with a capacity of 100 records.
  3. First and last names are read as single words, so names containing spaces are not supported by the current input flow.
  4. Individual subject marks are not persisted in the text file; only the total and average are saved.
  5. The program is optimized for a Windows console and is not fully portable to Linux or macOS without code changes.
  6. The current implementation does not provide a dedicated validation check for duplicate student IDs.
  7. There is no authentication, multi-user access control, or database backend.

Suggested Future Improvements

Future versions could replace the fixed-size array with std::vector, move the storage path to a configuration file, persist all subject marks, support names containing spaces, validate duplicate IDs, and replace the text-file format with a structured format or database. Separating the user interface, validation, storage, and business logic into distinct modules would also improve maintainability and testability.

Contributing

Contributions are welcome. When proposing a change, describe the problem being solved, keep the implementation focused, update the documentation when behavior changes, and verify the application manually on a supported Windows environment.

License

No license file is currently included in this repository. Unless a license is added by the project owner, reuse, modification, and redistribution rights should be considered unspecified.

References

About

πŸŽ“ A simple C++ console application to manage student records, including add, edit, delete, search, and sort features. πŸ’Ύ Data is stored in a local text file and auto-saved after every change.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages