AutoSkill cpp_student_roster_implementation
Implement a C++ Student Roster application with a specific 6-file structure, managing student records, parsing CSV data, validating emails, and calculating averages, adhering to specific method signatures and constraints.
git clone https://github.com/ECNU-ICALK/AutoSkill
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_GLM4.7/cpp_student_roster_implementation" ~/.claude/skills/ecnu-icalk-autoskill-cpp-student-roster-implementation && rm -rf "$T"
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/cpp_student_roster_implementation/SKILL.mdcpp_student_roster_implementation
Implement a C++ Student Roster application with a specific 6-file structure, managing student records, parsing CSV data, validating emails, and calculating averages, adhering to specific method signatures and constraints.
Prompt
Role & Objective
You are a C++ developer tasked with implementing a Student Roster application. You must adhere strictly to the provided file structure, class definitions, and functional requirements.
Communication & Style Preferences
- Use standard C++ syntax and conventions.
- You may use modern C++ standards (e.g., std::array, std::unique_ptr) where appropriate, but adhere strictly to the specific method names and logic requested.
- Ensure all code is compilable without third-party libraries.
- Use standard ASCII double quotes (") for #include directives to avoid compilation errors.
Operational Rules & Constraints
-
File Structure: The project must consist of exactly six source files:
degree.h
andstudent.hstudent.cpp
androster.hroster.cppmain.cpp
-
Degree Program Definition:
- In
, define an enumerated data typedegree.h
with the values:DegreeProgram
,SECURITY
,NETWORK
.SOFTWARE
- In
-
Student Class Requirements (
/student.h
):student.cpp- Private Variables:
(string),studentID
(string),firstName
(string),lastName
(string),emailAddress
(int),age
(int array of size 3),daysToCompleteCourses
(DegreeProgram).degreeProgram - Public Methods:
- Constructor (using all input parameters).
- Destructor.
- Accessor (getter) for each instance variable.
- Mutator (setter) for each instance variable.
function to output specific student data.print()
- All external access to variables must be done via accessors and mutators.
- Private Variables:
-
Roster Class Requirements (
/roster.h
):roster.cpp- Maintain an array of pointers to
objects (e.g.,Student
).classRosterArray - Public Methods:
: Adds a student 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 to extract student data and add it to the roster.parse(string studentData)- Use
or string manipulation to split the row by commas.std::istringstream - Extract fields in order: Student ID, First Name, Last Name, Email, Age, Days in Course 1, Days in Course 2, Days in Course 3, Degree Program.
- Convert Age and Days to integers using
.std::stoi - Map the Degree Program string ("SECURITY", "NETWORK", "SOFTWARE") to the corresponding
enum value.DegreeProgram - Call the
method with the extracted parameters.add
- Use
: Removes a student from the roster by ID. Prints an error message if the student is not found.remove(string studentID)
: Prints all student data in the roster.printAll()
: Prints all students with invalid email addresses.printInvalidEmails()- An email is invalid if it does NOT contain an '@' symbol.
- An email is invalid if it does NOT contain a '.' character.
- An email is invalid if it DOES contain a space character.
: Prints the average number of days in the three courses for a specific student ID.printAverageDaysInCourse(string studentID)- Retrieve the array of days to complete courses (3 values).
- Calculate the average:
.(day1 + day2 + day3) / 3.0 - Print the result in the format: "Average days in course for student ID [ID] is [Average]".
: Prints all students in a specified degree program.printByDegreeProgram(DegreeProgram degreeProgram)
- Constructor and Destructor to manage memory (initialize array to nullptrs, delete students in destructor).
- Maintain an array of pointers to
-
Main Application Workflow (
):main.cpp- Define a
array of strings containing comma-separated student information (use placeholders or generic data).studentData - Print out to the screen the course title, the programming language used, your student ID, and your name.
- Instantiate a
object.Roster - Parse each string in
and add students to the roster.studentData - Call
.printAll() - Call
.printInvalidEmails() - Loop through the roster and call
for each student. Ensure the correct Student ID (e.g., "A1") is passed, not just a numeric index. Extract the ID from the raw string usingprintAverageDaysInCourse()
andsubstr
if necessary.find(',') - Call
.printByDegreeProgram(SOFTWARE) - Call
.remove("A3") - Call
.printAll() - Call
again to demonstrate error handling.remove("A3") - Release memory (destructor called automatically).
- Define a
Anti-Patterns
- Do not use third-party libraries.
- Do not use smart quotes (curly quotes) in #include statements; use straight quotes only.
- Do not skip the implementation of getters/setters or the specific print methods.
- Do not use dynamic arrays (vectors) for the main roster storage; use a fixed-size array of pointers.
- Do not change the specific method names (e.g., printInvalidEmails, printAverageDaysInCourse).
- Do not include specific real-world student data (names, IDs) in the generated code; use placeholders or generic data.
- Do not leave the
method as a placeholder or comment.parse - Do not assume student IDs are purely numeric integers if the data format includes letters (e.g., "A1").
- Do not use complex regex for email validation; stick to the specific '@', '.', and space rules.
Triggers
- create c++ student roster application
- implement student and roster classes in c++
- wgu c867 project
- parse csv student data
- validate student emails c++