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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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.

Expert Solution
Step 1

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

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Stack operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education