On a boring Friday, you are sitting alone in your room. Due to the lockdown, you cannot go out to play with your friends, so you had nothing to do at home. Suddenly, your little sister comes and tells you that some of your family members want to play an interesting game called “Friday Fun". Therefore, you decided to join in the game. There are few rules in the game: a. All the members that will play the game must sit in a circular manner. b. There will be packet that they need to pass. c. There will be a dice, which will determine the faith of the player. d. If dice after flipping get 1 or 6', the player has to pass the packet to the next player (sitting to his/her right). e. If dice after flipping get '3 or 5, then the player is in danger but does not get eliminated, so the player has to pass it to the next member (sitting to his/her right). f. If dice after flipping get '2 or 4, the player gets eliminated and passes the packet to the next player (sitting to his/her right). g. The game continues until there is only one member left and he/she will get a surprisc gift. с. Write a method that finds out the winner of the 'Friday Fun' game, you will be given as input the number of players playing and the dice sequence. [You must use recursion for

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
100%

using recursion please

8. On a boring Friday, you are sitting alone in your room. Due to the lockdown, you cannot
go out to play with your friends, so you had nothing to do at home. Suddenly, your little
sister comes and tells you that some of your family members want to play an interesting
game called “Friday Fun". Therefore, you decided to join in the game. There are few
rules in the game:
a. All the members that will play the game must sit in a circular manner.
b. There will be packet that they need to pass.
c. There will be a dice, which will determine the faith of the player.
d. If dice after flipping get 1 or 6', the player has to pass the packet to the
next player (sitting to his/her right).
e. If dice after flipping get '3 or 5, then the player is in danger but does not
get eliminated, so the player has to pass it to the next member (sitting to
his/her right).
f. If dice after flipping get '2 or 4, the player gets eliminated and passes the
packet to the next player (sitting to his/her right).
g. The game continues until there is only one member left and he/she will get
a surprisc gift.
Write a method that finds out the winner of the 'Friday Fun' game, you will be given as
input the number of players playing and the dice sequence. [You must use recursion for
Transcribed Image Text:8. On a boring Friday, you are sitting alone in your room. Due to the lockdown, you cannot go out to play with your friends, so you had nothing to do at home. Suddenly, your little sister comes and tells you that some of your family members want to play an interesting game called “Friday Fun". Therefore, you decided to join in the game. There are few rules in the game: a. All the members that will play the game must sit in a circular manner. b. There will be packet that they need to pass. c. There will be a dice, which will determine the faith of the player. d. If dice after flipping get 1 or 6', the player has to pass the packet to the next player (sitting to his/her right). e. If dice after flipping get '3 or 5, then the player is in danger but does not get eliminated, so the player has to pass it to the next member (sitting to his/her right). f. If dice after flipping get '2 or 4, the player gets eliminated and passes the packet to the next player (sitting to his/her right). g. The game continues until there is only one member left and he/she will get a surprisc gift. Write a method that finds out the winner of the 'Friday Fun' game, you will be given as input the number of players playing and the dice sequence. [You must use recursion for
Sample Sample Explanation
Input
Output
1st turn: Starting from 1, the dice is '1', so he passes it to the second player.
2nd turn: dice is "5', so the second player passes it to the third member.
3rd turn: dice is '2', so the third player gets eliminated and passes it to the
3,
"152"
first member.
| 4rd turn: dice is '1’ so the first player passes it to the second player.
5th turn: dice is '5' so the second player passes it to the first player.
| 6th turn: dice is '2', so the first player gets eliminated and passes it to the
second player.
No further round is required as there is only one member so the winner is
the second player.
Transcribed Image Text:Sample Sample Explanation Input Output 1st turn: Starting from 1, the dice is '1', so he passes it to the second player. 2nd turn: dice is "5', so the second player passes it to the third member. 3rd turn: dice is '2', so the third player gets eliminated and passes it to the 3, "152" first member. | 4rd turn: dice is '1’ so the first player passes it to the second player. 5th turn: dice is '5' so the second player passes it to the first player. | 6th turn: dice is '2', so the first player gets eliminated and passes it to the second player. No further round is required as there is only one member so the winner is the second player.
Expert Solution
steps

Step by step

Solved in 4 steps with 3 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