Question: in c programming Arcade Management Objective Give practice with linked lists and stacks. Story You opened a retro arcade using the capital obtained from your





Arcade Management Objective Give practice with linked lists and stacks. Story You opened a retro arcade using the capital obtained from your handle generator venture. It's pretty popular among the denizens of Gameland. Most people in Gameland have never seen an arade before woah. You have decided to list the most valuable player in this case the person in your store that entered with the most amount of money). This is totally not going to backfire or be a huge violation of trust The problem you are having is that your system only records two events: 1) the name and the amount of money held by the player entering or 2) if someone is leaving the system does not say who). Luckily, people like your arcade so much that they refuse to leave before everyone that arrived AFTER them has already left. It makes it very easy to determine who exits when someone leaves. Problem Given a list of people entering and leaving determine at certain (specified) moments the most valuable player Input Each line of input will start with a non-negative integer, t(Osts 3), representing the type of line to process. Iftis 0, then the day is over and the program should terminate. Iftis 1, then the program should read in the following player information that is entering the arcade. The player's information is composed of two values separated by a space, an integer, M, and string, S (1 SM S 10', 1 S S S 20), representing the amount of money in tokens and the name of the player entering. If t is 2. then the program should process a player leaving. No further information is provided when t is 2. iftis 3, then your program should output the most valuable player in the arcade. Output Output should contain 1 line for each 3 entered. Each line will contain the name of the most valuable player at the time of the request. If two players entered with the same amount of money, print the most recent one (they have probably spent less money than the other one). Sample Input 1 5 Eric 1 10 John 1 2 Kate 1 30 Ash Sample Output John Ash John Eric 3 1 3 Josh 14 Grace 3 1 5 is Soreloser 3 1 6 Real FunnyJosh Grace isAsoreLoser RealFunny Josh RealFunnyJosh Josh | Explanation Case 1 Time 1 2 3 4 People in the arcade Eric Eric, John Eric, John, Kate Eric, John, Kate Eric, John, Kate, Ash Eric, John, Kate, Ash Eric, John, Kate Eric, John Eric, John 5 Event Eric enters with 5 tokens John enters with 10 tokens Kate enters with 2 tokens Print the MVP (John) Ash enters with 30 tokens Print the MVP (Ash) Someone leaves (Ash) Someone leaves (Kate) Print the MVP (John) Someone leaves (John) Print the MVP (Eric; by default) The store closes Someone should check on 6 7 8 9 10 Eric 11 Eric 12 Eric Eric Caso 2 Time 1 2 3 Event People in the arcade Josh enters with 3 tokens Josh. Grace enters with 4 tokens Josh, Grace Print the MVP (Grace) Josh. Grace isSoreloser enters with 5 Josh, Grace, isSoreloser tokens (o_O) Print the MVP (iSASoreloser) Josh. Grace, is Soreloser 4 5 6 7 8 9 RealFunny Josh enters with 6 Josh, Grace, isSoreLoser, token (>_
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
