A C++ console application that manages a student class roster — parsing enrollment data, validating records, and reporting statistics by student and degree program.
Built as the capstone project for C867: Scripting and Programming – Applications at Western Governors University.
The application ingests a fixed set of student records, parses them from comma-delimited strings into structured objects, and produces several reports:
- Full class roster
- Invalid email addresses (missing
@, missing., or containing spaces) - Average days to course completion per student
- Students filtered by degree program
- Dynamic add and remove operations with verification
StudentRoster/
├── StudentRoster.sln # Visual Studio solution file
└── StudentRoster/
├── main.cpp # Entry point and demo sequence
├── student.h # Student class declaration
├── student.cpp # Student class implementation
├── roster.h # Roster class declaration
├── roster.cpp # Roster class implementation
└── degree.h # DegreeProgram enum
Represents a single enrolled student.
| Member | Type | Description |
|---|---|---|
studentID |
std::string |
Unique identifier (e.g. A1) |
fname / lname |
std::string |
First and last name |
email |
std::string |
Email address |
age |
int |
Student age |
numDays |
std::array<int, 3> |
Days to complete each of 3 courses |
degree |
Degree |
Enrolled degree program |
Full getter/setter interface, a parameterized constructor, a parse-friendly default constructor, and a print() method for formatted output.
Manages a dynamic array of Student pointers.
| Method | Description |
|---|---|
add(...) |
Adds a student by individual fields |
add(Student) |
Adds a pre-constructed Student object |
parse(string) |
Parses a comma-delimited data string into a Student |
remove(studentID) |
Removes a student by ID and shifts the array; reports if not found |
printAll() |
Prints every student in the roster |
printInvalidEmails() |
Flags emails missing @, missing ., or containing spaces |
printAverageDaysInCourse(studentID) |
Prints the average completion days for one student |
printByDegreeProgram(Degree) |
Filters and prints students by degree |
enum Degree {
SECURITY,
NETWORK,
SOFTWARE
};C867 Scripting and Programming - Applications
C++
ID: 011353584
Michael Roberts
<============================ Class ===========================>
A1 First Name: John Last Name: Smith Age: 20 DaysInCourse: {30, 35, 40} Degree Program: SECURITY
A2 First Name: Suzan Last Name: Erickson Age: 19 DaysInCourse: {50, 30, 40} Degree Program: NETWORK
A3 First Name: Jack Last Name: Napoli Age: 19 DaysInCourse: {20, 40, 33} Degree Program: SOFTWARE
A4 First Name: Erin Last Name: Black Age: 22 DaysInCourse: {50, 58, 40} Degree Program: SECURITY
A5 First Name: Michael Last Name: Roberts Age: 31 DaysInCourse: {40, 30, 20} Degree Program: SOFTWARE
<=========================== Invalid Emails =======================>
John1989@gm ail.com
Erickson_1990@gmailcom
The_lawyer99yahoo.com
<=========================== Average Days in Course per student ==================>
Average days in course for John is 35
Average days in course for Suzan is 40
Average days in course for Jack is 31
Average days in course for Erin is 49
Average days in course for Michael is 30
<============================== Software Degree Program ==============================>
A3 First Name: Jack Last Name: Napoli Age: 19 DaysInCourse: {20, 40, 33} Degree Program: SOFTWARE
A5 First Name: Michael Last Name: Roberts Age: 31 DaysInCourse: {40, 30, 20} Degree Program: SOFTWARE
<============================ New Class ===========================>
A1 First Name: John Last Name: Smith Age: 20 DaysInCourse: {30, 35, 40} Degree Program: SECURITY
A2 First Name: Suzan Last Name: Erickson Age: 19 DaysInCourse: {50, 30, 40} Degree Program: NETWORK
A4 First Name: Erin Last Name: Black Age: 22 DaysInCourse: {50, 58, 40} Degree Program: SECURITY
A5 First Name: Michael Last Name: Roberts Age: 31 DaysInCourse: {40, 30, 20} Degree Program: SOFTWARE
Student with ID A3 not found.
- Windows with Visual Studio 2019+ (Community edition is free)
- C++14 or later (configured in project properties)
- Clone or download the repository
- Open
StudentRoster.slnin Visual Studio - Press Ctrl+F5 to build and run without the debugger
cl /EHsc /std:c++14 main.cpp student.cpp roster.cpp /Fe:StudentRoster.exe
StudentRoster.exe- Object-oriented design — encapsulated
StudentandRosterclasses with clean public interfaces - Dynamic memory management — heap-allocated student array using
new/delete - CSV parsing —
std::istringstream+std::getlineto tokenize delimited strings - String validation — email format checking without external libraries
- Pointer arithmetic — manual array compaction on removal
- Enum types —
Degreeenum for type-safe degree program representation - Separation of concerns — declarations in
.h, implementation in.cpp
- Roster capacity is initialized to 5; the resize path in
add()is present but not fully functional — extending beyond the initial capacity is not supported in the current version. SIZEandCOUNTare implemented as global variables; a future refactor would make these private members ofRoster.- No destructor is implemented on
Roster— the heap-allocated student pointers are not explicitly freed on program exit.
C867 – Scripting and Programming: Applications
Western Governors University
Language: C++ | IDE: Visual Studio