c++ programming

I don’t understand this C Programming question and need help to study.


You are to implement a C++ class to manage enrollment in a Computer Science department course: Multiple Graduate and Undergraduate students are waitlisted by reading their names from a text file. Periodically, the program enrolls students in order according to the following policy.

  • All graduate students have higher priority than undergraduates.
  • Among graduates and undergraduates, students must be selected in the order they signed-up.

For example, if the text file contains:

U: Tommy Titanunder
U: Tina Tuskerunder
G: Jim Jumbograd
U: Dottie Dumbounder
G: Bob Babargrad

(Note the format: each line begins with U: or G: indicating an undergraduate/graduate, followed by the first name and last name.)

During enrollment, the students should be printed like so:

1. Jim Jumbograd
2. Bob Babargrad
3. Tommy Titanunder
4. Tina Tuskerunder
5. Dottie Dumbounder

Implement your logic within a class Enrollment. The class should have the following public member functions:

  1. Enrollment(): the default constructor
  2. void waitlist (string filename): read the given file and add the students to your program’s data structure(s) – the “waitlist”. Note that waitlist() can be called multiple times and the names in all files should be added.
  3. void enroll(): print the students on the waitlist according to the policy described above. After printing, the waitlist becomes empty. So if enroll() is called again, nothing is printed.

These public member functions will be called from the provided main() in part2.cpp. Look at part2.cpp to see the expected output and check your answers.

  • You are free to add other (public/private) member variables and functions to class Enrollment, and any other structs/classes as needed.
  • You can implement all your code either in one header file called Enrollment.h or split the declaration and definition in Enrollment.h and Enrollment.cpp
  • You do not need to do error checking (if the file is empty, names are repeated, etc.).
  • You can modify the main function to test your code with different input cases to make sure the logic will work in the general case – we will test your code with different text files which will contain different names not included here.
  • Hint: each line can be read like so:
  • mystream >> gradOrUndergrad >> firstname >> lastname

Data structure resources:

You are encouraged to use only the C++ Standard Library containers.

However, you are also given files containing templates for a Vector, singly and doubly linked list, Stack, and a Queue. For these data structures, you are also provided with a test program. You may use none, any, or all of them if it will help you. You are also free to edit any of these files. These files are posted in the “Data structure files for Part 2 (OPTIONAL)” section.


A short description of your approach. This should be turned in as a long comment at the beginning of Enrollment.h. Make clear what, if any, data structures you use and their roles.

File submission: Upload as separate files (do not zip):

  • Enrollment.h
  • Enrollment.cpp (if used)
  • Any additional files that you wrote or edited.


clang++ -std=c++17 part2.cpp Enrollment.cpp


Answering this question is not essay as it seems. It will require you to research or burn your brain power, write your findings down, edit, proofread severally, and submit unsure of the grade you will get. Essay96.com assignment writers are offering to take care of that. Order your assignment now, relax, submit, and enjoy excellent grades. We guarantee you 100% original answers, timely delivery, and some free products.



Posted in Uncategorized