A group of people, numbered 1 to N, are sitting in a circle. Starting at person 1, a hot potato is passed. After x number of passes, the person holding the hot potato is eliminated, the circle closes ranks, and the game continues with the person who was sitting after the eliminated person picking up the hot potato. The last remaining person wins. For example: number of passes = 1 and number of players = 5, the order of elimination is 2, 4, 1, 5. Write a program for general values of X and N. Ask a user for the number of people and number of passes To speed up the input and debugging, you may wish to store the names of the people in a file. Make sure no two names start the same letter ( Alex and Ana are not OK). Alternatively, you can number the players. Output number and/or the name of a person being eliminated Output number and the name of the winner Do not expect a user to do the right thing, error check the user input; among other things, what do you think a reasonable minimum number of players would be? Allow user to play the game as many times as the user wants Node and List must be classes classes must adhere to best practices and standards if any part of an object is a pointer or dynamically allocated, follow the rule of three use try/catch to check dynamic memory allocation C++ Dynamic Memory Allocation Supplement Download C++ Dynamic Memory Allocation Supplement Make sure each function has a description, post, and pre-conditions

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

A group of people, numbered 1 to N, are sitting in a circle. Starting at person 1, a hot potato is passed. After x number of passes, the person holding the hot potato is eliminated, the circle closes ranks, and the game continues with the person who was sitting after the eliminated person picking up the hot potato. The last remaining person wins.

For example:

  • number of passes = 1 and number of players   = 5, the order of elimination is 2, 4, 1, 5.   

Write a program for general values of X and N.

  • Ask a user for the number of people and number of passes
  • To speed up the input and debugging, you may wish to store the names of the people in a file. Make sure no two names start the same letter ( Alex and  Ana are not OK). Alternatively, you can number the players.
  • Output number and/or the name of a person being eliminated
  • Output number and the name of the winner
  • Do not expect a user to do the right thing, error check the user input; among other things, what do you think a reasonable minimum number of players would be?
  • Allow user to play the game as many times as the user wants
  • Node and List must be classes
    • classes must adhere to best practices and standards
    • if any part of an object is a pointer or dynamically allocated, follow the rule of three
  • use try/catch to check dynamic memory allocation C++ Dynamic Memory Allocation Supplement Download C++ Dynamic Memory Allocation Supplement
  • Make sure each function has a description, post, and pre-conditions
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY