This project is a C++ implementation of a simple course registration system. It demonstrates object-oriented programming concepts such as classes, constructors, copy constructors, assignment operators, dynamic memory management, and file processing.
The program models courses and students, allowing students to be enrolled in courses while respecting maximum enrollment limits. It also reads course and student data from an input file and displays the processed information.
| File | Description |
|---|---|
Makefile |
Compiles the project and generates the executable. |
README.md |
Project documentation. |
course.cpp |
Implementation of the Course class. |
student.cpp |
Implementation of the Student class. |
utils.cpp |
Utility functions, including file processing functions. |
program3.h |
Header file containing class declarations and function prototypes. |
program3_driver.cpp |
Driver program that tests the classes and processes course registration data. |
course_and_student_data.txt |
Sample input file containing course and student information. |
test_data.txt |
Additional input file for testing the program. |
- Create
Studentobjects using default, parameterized, and copy constructors. - Create
Courseobjects using default, parameterized, and copy constructors. - Enroll students into courses.
- Prevent enrollment when the maximum capacity has been reached.
- Increase a course's maximum enrollment dynamically.
- Display all students enrolled in a course.
- Test the copy constructor and assignment operator for the
Courseclass. - Read course and student information from an input file.
- Store processed data in arrays of
CourseandStudentobjects. - Display processed course information and enrollment summaries.
The program performs the following steps:
- Checks that an input file is provided as a command-line argument.
- Tests the
Studentclass constructors and member functions. - Tests the
Courseclass by:- Creating course objects
- Enrolling students
- Checking enrollment limits
- Increasing course capacity
- Testing the copy constructor
- Testing the assignment operator
- Opens the specified input file.
- Processes course and student information from the file.
- Displays all processed courses and their enrolled students.
- Prints the total number of courses and students processed.
The program accepts a text file containing course and student information.
Included sample input files:
course_and_student_data.txttest_data.txt
- Object-Oriented Programming (OOP)
- Classes and Objects
- Constructors and Destructors
- Copy Constructors
- Assignment Operators
- Dynamic Memory Management
- Arrays of Objects
- File Input (
ifstream) - Command-Line Arguments
- Modular Programming
- Encapsulation