Question: Problem using the STL Queue. Focus on the main program. A Jewish historian living in the 1 st century named Flavius Josephus gave an account
Problem using the STL Queue. Focus on the main program. A Jewish historian living in the st century named Flavius Josephus gave an account of the siege of Yodfat, where he and his soldiers were trapped in a cave by Roman soldiers. Choosing suicide over capture, they settled on a serial method of committing suicide where each person to die would be killed by the next person to die. Josephus states that by luck or possibly the hand of God, he and another man remained until the end and surrendered to the Romans rather than killing themselves.
The precise mechanism for choosing the order of the executions was not completely described in Josephus' account, however in Claude Gaspar Bachet suggested that the men arranged themselves in a circle, and then started counting by threes from a randomly selected man.
Devise a program that prompts the user for a number of people in a circle, and a value nn where every nnth person will be killed, and then finds using a queue and displays the positions of those people killed, in the order they died.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
