Skip to content

MikeyRobby/StudentRoster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Student Roster

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.


Overview

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

Project Structure

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

Classes

Student

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.

Roster

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

Degree (enum)

enum Degree {
    SECURITY,
    NETWORK,
    SOFTWARE
};

Sample Output

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. 

Building and Running

Requirements

  • Windows with Visual Studio 2019+ (Community edition is free)
  • C++14 or later (configured in project properties)

Steps

  1. Clone or download the repository
  2. Open StudentRoster.sln in Visual Studio
  3. Press Ctrl+F5 to build and run without the debugger

Command Line (MSVC)

cl /EHsc /std:c++14 main.cpp student.cpp roster.cpp /Fe:StudentRoster.exe
StudentRoster.exe

Key Concepts Demonstrated

  • Object-oriented design — encapsulated Student and Roster classes with clean public interfaces
  • Dynamic memory management — heap-allocated student array using new / delete
  • CSV parsingstd::istringstream + std::getline to tokenize delimited strings
  • String validation — email format checking without external libraries
  • Pointer arithmetic — manual array compaction on removal
  • Enum typesDegree enum for type-safe degree program representation
  • Separation of concerns — declarations in .h, implementation in .cpp

Known Limitations

  • 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.
  • SIZE and COUNT are implemented as global variables; a future refactor would make these private members of Roster.
  • No destructor is implemented on Roster — the heap-allocated student pointers are not explicitly freed on program exit.

Course

C867 – Scripting and Programming: Applications
Western Governors University
Language: C++ | IDE: Visual Studio


Author

Michael Roberts
Student ID: 011353584
GitHub · Gitea

About

Project for C867 at Western Governors University 2025

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors