Answer in C
Please provide 3 or more files for this program:
Hundreds of people line up on a Friday morning to order food at Mary’s Fried Chicken. To help the situation, the owner gives everybody a raffle ticket when they add their name to the wait line and then periodically they call out a ticket number and that person may choose from: 1. Go to the front of the line, or 2. Have a free t-shirt.
Write a menu-driven program that utilizes a FIFO dynamic queue and recursion to simulate the Mary’s Fried Chicken wait line. Do NOT utilize the C STL to implement the queue or the queue operations.
Your menu must include:
1. Add a Name (input the name from the user and assign them a unique raffle ticket number between 1 and 500 and then add them to the end of the line )
2. Make an order (allow-front-of-line name to place their order – display their name and a message that they can order and then delete from the front of the line. )
3. Count names in line (display the total number of names in the line). **you must use recursion to accomplish this item
4. Draw Raffle Winner (randomly pick raffle number from those previously assigned. Locate the person who has that number.) **you must use recursion to accomplish this. If that person is no longer in the line, display a message.
Winner gets to choose from the 2 options as described above. If they choose go to front of the line then move them to the front. If they choose free t-shirt then display that information.
5. Display the Line, including name, raffle ticket number and position in the queue.
6. Help your BFF (input and search for a specific name and if it exists, move them to the front of the line; if no friend in line display message.) **you must use recursion to accomplish this item.
Member data for each node must include:
1. name ( <20 char's and must not be empty)
2. raffle ticket number (unique number between 1 and 500 assigned by the program) *Note: we will not test for uniqueness
Programming Rules:
Implement this queue with a FIFO linked list (nodes and pointers). Both high and low level validation must be present in your program. Structured code, good documentation, good use of functions will be graded. A program that throws exceptions will cost you points – make sure to test your code. Professional I/O is expected – columns should be aligned on output, etc. No use of the queue from the C STL.
– In a separate note, please provide the names of the functions that use recursion
SAMPLE OUTPUT FOR THE PROGRAM:
Mary’s Fried Chicken – Menu1. Add a Name 2. Make an Order 3. Count Names 4. Draw Raffle Winner 5. Display Line 6. Help your BFF 7. Exit Menu
Choose your Option: 1
Enter your name: Ana
Welcome to Mary’s – your raffle number is 6
**Display the Menu from above
Choose your Option: 1Enter your name: SamWelcome to Snow’s – your raffle number is 14
**Display the Menu from above
Choose your Option: 1Enter your name: MikeWelcome to Snow’s – your raffle number is 3
**Display the Menu from above
Choose your Option: 1Enter your name: KatelynnWelcome to Snow’s – your raffle number is 65
**Display Menu
Choose your Option: 1Enter your name: BrianWelcome to Snow’s – your raffle number is 23
**Display Menu
Choose your Option: 5(0) Ana 6(1) Sam 14(2) Mike 3(3) Katelynn 65(4) Brian 23
**Display Menu
Choose your Option: 2Ana, you can order now!
**Display the Menu from above
Choose your Option: 5(0) Sam 14(1) Mike 3(2) Katelynn 65(3) Brian 23
**Display the Menu from above
Choose your Option: 3Number of people in the line: 4
**Display the Menu from above
Choose your Option: 4The winning raffle number is 3.Mike, do you want:1. To move to the front of the line, or2. A free t-shirtChoose your option: 1Mike, you are being moved to the front of the line!
**Display the Menu from above
Choose your Option: 5(0) Mike 3(1) Sam 14(2) Katelynn 65(3) Brian 23
**Display the Menu from above
Choose your Option: 6Please input the name of your BFF: StaciNobody named Staci is in the line at this time.
**Display the Menu from above
Choose your Option: 6Please input the name of your BFF: SamSam, you are being moved to the front of the line!
PLEASE REVIEW ATTACHED PDF FOR HOW COMMENTS SHOULD LOOK LIKE IN THE PROGRAM. PLEASE LEAVE COMMENTS.