This program modifies the registration system from parts 1 and 2 by splitting the program into two source files and one header file, following modular programming principles.
Table of Contents 📖
Modify the registration program from Project 9 by splitting the program into two source files and one header file:
student.c
: Contains all functions related to operations on the list of students.student.h
: Contains thestudent
structure declaration and function prototypes for the functions instudent.c
, enclosed in an#ifndef
-#endif
pair to protect the file.student_registration.c
: Contains the main function.
- User inputs an operation code for various actions like adding a student, removing a student, or listing students.
- The program prompts the user for the student's name, NetID, grade in COP2510, GPA, and the number of previous attempts as necessary.
- Output will be the list of students in the queue based on the current operation.
- The program will output a formatted table listing students when requested.
Enter the name of the student: Mauricio Pamplona
Enter the NetID of the student: mauriciop
Enter the COP2510 letter grade: B
Enter the GPA: 2.5
Enter the number of previous attempts: 2
Enter operation code: a
Enter the name of the student: Jing Wang
Enter the NetID of the student: jw
Enter the COP2510 letter grade: A
Enter the GPA: 3.5
Enter the number of previous attempts: 1
Enter operation code: l<br>
|----------------------|----------------------|---------|-----|----------|
| Name | NetID | COP2510 | GPA | Attempts |
|----------------------|----------------------|---------|-----|----------|
| Mauricio Pamplona | mauriciop | B | 2.5 | 2 |
|----------------------|----------------------|---------|-----|----------|
| Jing Wang | jw | A | 3.5 | 1 |
|----------------------|----------------------|---------|-----|----------|
Explanation:
- The program adds students to the list and lists them after an 'a' operation and the 'l' operation is called to list all students in the queue.
- The program should be split into three files:
student.c
,student.h
, andproject10_registration.c
. student.c
should contain functions related to operations on the list of students.student.h
should contain thestudent
structure and the function prototypes for functions instudent.c
, with appropriate use of#ifndef
-#endif
guards.project10_registration.c
should contain themain
function.- The program should compile correctly when the files are split as described.
1. Compile the Program:
2. Run the Program:
3. Input Required:
- Choose an operation code (e.g., 'a' for adding a student, 'p' for popping a student).
- Provide the necessary details depending on the operation selected (student name, NetID, etc.).