sing good OOP, write a C++ program that will read an input file to manage a list of students waiting to register for a ourse using a linked list. The input file name is WaitList.txt and is located in the current directory of the project. 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 Tutor 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. Be sure to 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.
sing good OOP, write a C++ program that will read an input file to manage a list of students waiting to register for a ourse using a linked list.
The input file name is WaitList.txt and is located in the current directory of the project.
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 Tutor
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.
Be sure to use good
Use private member functions and variables.
Use public member functions for a constructor (where appropriate) and a driver method only.
Given that,
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.
The file layout is as follows:
action student name
Actions are defined as follows:
1 - add a student name to the end of the linked list
2 - add a 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 Tutor
1 Abby Achiever
3
2 Bill Brain
The program would display the waitlist 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 waitlist is then displayed. If the name is not found, an error message is displayed to the user.
If the user selects 'n' to delete 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: case clever
The student does not exist on the waitlist.
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.
Be sure to 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.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps