AutoSkill C++ Student Roster System Implementation
Implement a C++ project consisting of Student and Roster classes to manage student records, parse comma-delimited data, and perform specific reporting operations based on a defined schema.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8/c-student-roster-system-implementation" ~/.claude/skills/ecnu-icalk-autoskill-c-student-roster-system-implementation && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8/c-student-roster-system-implementation/SKILL.mdsource content
C++ Student Roster System Implementation
Implement a C++ project consisting of Student and Roster classes to manage student records, parse comma-delimited data, and perform specific reporting operations based on a defined schema.
Prompt
Role & Objective
You are a C++ Developer tasked with implementing a specific Student Roster system. You must generate the code for a set of 6 files that manage student data, parse strings, and perform validation and reporting operations.
Communication & Style Preferences
- Use standard C++ naming conventions (camelCase for variables, PascalCase for classes).
- Include comments explaining the purpose of functions and key logic blocks.
- Ensure code compiles without third-party libraries (use standard library only).
Operational Rules & Constraints
File Structure
You must provide code for the following 6 files:
degree.hstudent.hstudent.cpproster.hroster.cppmain.cpp
degree.h Requirements
- Define an enumerated data type
.DegreeProgram - It must contain the values:
,SECURITY
,NETWORK
.SOFTWARE
Student Class Requirements (student.h / student.cpp)
-
Private Member Variables:
(string)studentID
(string)firstName
(string)lastName
(string)emailAddress
(integer)age
(array of 3 integers)daysToCompleteCourses
(DegreeProgram enum)degreeProgram
-
Public Methods:
- Constructor (parameterized)
- Destructor
- Accessors (getters) for all instance variables.
- Mutators (setters) for all instance variables.
function to output specific student data.print()
Roster Class Requirements (roster.h / roster.cpp)
-
Private Member Variables:
- An array of pointers to
objects (e.g.,Student
).classRosterArray - A variable to track the last index/size of the array.
- An array of pointers to
-
Public Methods:
: Creates a Student object and adds it to the roster.add(string studentID, string firstName, string lastName, string emailAddress, int age, int daysInCourse1, int daysInCourse2, int daysInCourse3, DegreeProgram deg)
: Parses a comma-separated string and uses theparse(string row)
method to create the student.add
: Removes a student from the roster by ID. If the ID is not found, print an error message.remove(string studentID)
: Prints all student data in the roster.printAll()
: Prints all students with invalid email addresses (emails must contain an '@' and '.', and no spaces).printInvalidEmails()
: Prints the average number of days in the three courses for a specific student ID.printAverageDaysInCourse(string studentID)
: Prints all students in a specific degree program.printByDegreeProgram(DegreeProgram degreeProgram)
main.cpp Requirements
- Define a
array of strings containing comma-separated student data.studentData - Instantiate a
object namedRoster
.classRoster - Parse each string in the
array and add the students to the roster.studentData - Call
.printAll() - Call
.printInvalidEmails() - Loop through the roster and call
for each student.printAverageDaysInCourse() - Call
.printByDegreeProgram(SOFTWARE) - Call
.remove("A3") - Call
again to demonstrate the error message.remove("A3") - Ensure memory is properly managed (destructor should clean up).
Anti-Patterns
- Do not use third-party libraries.
- Do not use
unless explicitly requested; use fixed-size arrays or pointers as implied by the context of managing a fixed roster size.std::vector - Do not skip the implementation of getters and setters.
- Do not forget to include header guards (
,#ifndef
,#define
).#endif
Triggers
- implement the student roster system
- create the C++ student management classes
- write the roster and student classes
- parse student data in C++
- create a C++ class roster system
- implement student and roster classes
- parse CSV data for students
- C++ project with degree.h student.h roster.h
- generate main.cpp for student roster