I need help on this home work: Using OOP, write a C++ program that will read an input file to manage a list of students waiting to register for a course using a linked list.The input file name is WaitList.txt and is located in the current directory of the project. Waitlist.txt content: 1 Samuel Stone1 Brett Bacher2 Emily Evans44331 Zachary Zillings2 Carson Cummings1 Penny Plumber31 Tammy Thompson The file layout is as follows:action student nameActions are defined as follows:1 - add student name to the end of the linked list2 - add student name to the beginning of the linked list3 - delete the student at the beginning of the linked list4 - delete the student at the end of the linked listActions #1 and #2 require student names. Actions #3 and #4 do not.For example, if the input file contents contained: 1 Sally Sue Student1 Peter Pupil1 Sam Scholar42 Terri Flowers1 Abby Achiever32 Bill Brain The program would display the wait list as follows: The Wait List:1. Bill Brain2. Sally Sue Student3. Peter Pupil4. Abby AchieverEnd of List. Then the program will prompt the user if they wish to delete a student by name. If the user selects 'y', the program will prompt for a student name.If the name is found in the linked list, the student node will be deleted and the wait list is then displayed. If the name is not found, an error message is displayed to the user.If the user selects 'n' to deleting a student by name, the program will end. The Wait List:1. Bill Brain2. Sally Sue Student3. Peter Pupil4. Abby AchieverEnd of List.Would you like to delete a student by name (y = yes, n = no): YEnter the full name of the student to delete: peter pupilStudent deleted.The Wait List:1. Bill Brain2. Sally Sue Student3. Abby AchieverEnd of List.Would you like to delete a student by name (y = yes, n = no): yEnter the full name of the student to delete: casey cleverStudent does not exist on the wait list.The Wait List:1. Bill Brain2. Sally Sue Student3. Abby AchieverEnd of List.Would you like to delete a student by name (y = yes, n = no): aInvalid response, please enter y = yes, n = no: nProgram end. Validate all user input values, and use good programming methodology and keep your project modular. Use private member functions and variables.Use public member functions for a constructor (where appropriate) and a driver method only.These specifications do not give a list of method names to be used. It is assumed the program will use several methods doing one task each.NOTE: Any submission that uses global variables or does not use a class and object appropriately will result in a project grade of 0.
I need help on this home work:
Using OOP, write a C++ program that will read an input file to manage a list of students waiting to register for a course using a linked list.
The input file name is WaitList.txt and is located in the current directory of the project.
Waitlist.txt content: |
1 Samuel Stone 1 Brett Bacher 2 Emily Evans 4 4 3 3 1 Zachary Zillings 2 Carson Cummings 1 Penny Plumber 3 1 Tammy Thompson |
The file layout is as follows:
action student name
Actions are defined as follows:
1 - add student name to the end of the linked list
2 - add student name to the beginning of the linked list
3 - delete the student at the beginning of the linked list
4 - delete the student at the end of the linked list
Actions #1 and #2 require student names. Actions #3 and #4 do not.
For example, if the input file contents contained:
1 Sally Sue Student 1 Peter Pupil 1 Sam Scholar 4 2 Terri Flowers 1 Abby Achiever 3 2 Bill Brain |
The program would display the wait list as follows:
The Wait List: 1. Bill Brain 2. Sally Sue Student 3. Peter Pupil 4. Abby Achiever End of List. |
Then the program will prompt the user if they wish to delete a student by name. If the user selects 'y', the program will prompt for a student name.
If the name is found in the linked list, the student node will be deleted and the wait list is then displayed. If the name is not found, an error message is displayed to the user.
If the user selects 'n' to deleting a student by name, the program will end.
The Wait List: 1. Bill Brain 2. Sally Sue Student 3. Peter Pupil 4. Abby Achiever End of List. Would you like to delete a student by name (y = yes, n = no): Y Enter the full name of the student to delete: peter pupil Student deleted. The Wait List: 1. Bill Brain 2. Sally Sue Student 3. Abby Achiever End of List. Would you like to delete a student by name (y = yes, n = no): y Enter the full name of the student to delete: casey clever Student does not exist on the wait list. The Wait List: 1. Bill Brain 2. Sally Sue Student 3. Abby Achiever End of List. Would you like to delete a student by name (y = yes, n = no): a Invalid response, please enter y = yes, n = no: n Program end. |
Validate all user input values, and use good
Use private member functions and variables.
Use public member functions for a constructor (where appropriate) and a driver method only.
These specifications do not give a list of method names to be used. It is assumed the program will use several methods doing one task each.
NOTE: Any submission that uses global variables or does not use a class and object appropriately will result in a project grade of 0.
Unlock instant AI solutions
Tap the button
to generate a solution