Reference no: EM131381723
This is a exercise about Java. I do not how to start to write.
Here is a variant of a famous old puzzle published originally in The Saturday Evening Post , 1926, in a short story entitled "Coconuts," by Ben Ames Williams.
Five sailors, stranded on an island, spent their first day collecting coconuts. In the evening, they put all the coconuts into a single pile and went to sleep.
Sailor One, distrustful of his fellow sailors, woke up during the night, took one fifth of the coconuts, and went back to sleep. Then, a hungry monkey shimmied down a tree and took 1 coconut. A bit later, Sailor Two awoke and took a fifth of the remaining coconuts. Again, the monkey came down and took a coconut. Later, the third, fourth, and fifth sailors did likewise and the monkey took a coconut each time. In the morning, when the five sailors tried to divide the remaining coconuts into five equal piles, they had one coconut left, which they tossed to the ever-hungry monkey. How many coconuts were in the original pile?
There is an infinite number of solutions to this puzzle. Each solution is of the form: number of coconuts = 12495 + 15625 * a, where a=0,1,2,3. . . .
For example, if a=0, then the original number of coconuts is 12495 + 15625 * 0 = 12495; and if a=1 the number is 12495 + 15625 * 1 = 28120. Your job is to write a program that accepts a non-negative integer a (You can assume the user will always input only a non-negative integer), calculates the initial number of coconuts and displays how many coconuts each sailor takes, as well as how many they share in the morning.
Network fundamental characteristics and components
: Select an organization you are familiar with, or select one of the Virtual Organizations (Riordan Manufacturing or Kudler Foods), for your project. This project will continue throughout the coming weeks and build upon itself culminating in Week Fi..
|
Write appropriate hypotheses
: Do these figures give evidence of a change in student attendance?
|
Describe the key characteristics of a whistleblower
: Describe the key characteristics of a whistleblower, and briefly summarize one (1) researched instance of whistleblowing in one (1) publicly traded company within the last 3 years. Include the details of the issue that the whistleblower reported a..
|
Security challenges for system administrators
: Bring Your Own Device created security challenges for system administrators. identify potential problem personal devices, share instances or examples of what makes them high risk, and provide potential solutions or advantages of a BYOD policy. you..
|
Infinite number of solutions to puzzle
: There is an infinite number of solutions to this puzzle. Each solution is of the form: number of coconuts = 12495 + 15625 * a, where a=0,1,2,3. . . .
|
Initial steps in creating a security policy
: Choose a company for this project and consider the initial steps in creating a security policy. Develop security goals and components that make up a quality Executive Summary.
|
Create a gui to display the structure
: Read a data file, create the internal data structure, create a GUI to display the structure, and let the user search the structure. Sort the structure, use hash maps to create the structure more efficiently.
|
Describe the considerations for leading multicultural teams
: BBA 3651:Assume that you have been tasked with preparing a cultural brief for an upcoming trip that will put you and your travel companions in touch with three different societal clusters. Choose three clusters other than the one in which you curr..
|
Neglect shear and moment considerations
: Unless otherwise noted, the given loads are superimposed loads; neglect the beam weight; neglect shear and moment considerations.
|