X marks the spot! Arr! Did you think that just because we’re pirates, we wouldn’t ask the Coding Hero for help? That’s discrimination! I have a map here that leads to a lot of treasures and I need your help to get them. Every treasure is hidden underground but the surface is marked with an X. To dig up the treasure, I need N number of sailors to dig it up, and the bigger the X, the bigger the treasure, and the more sailors (N) I need to dig it up! I need to know how big of an X I can dig up if I bring N number of men with me so I can optimize the split of the treasure. By the way, N can only be greater than 3 and it can only be an odd integer. You better do it quickly or you’ll be sleeping with the fishes!   Inputs 1. Number of sailors The value is >= 3 and is odd   Sample Output Enter the number of sailors: 3 * * * * * * * * *

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question

X marks the spot! Arr! Did you think that just because we’re pirates, we wouldn’t ask the Coding Hero for help? That’s discrimination! I have a map here that leads to a lot of treasures and I need your help to get them. Every treasure is hidden underground but the surface is marked with an X. To dig up the treasure, I need N number of sailors to dig it up, and the bigger the X, the bigger the treasure, and the more sailors (N) I need to dig it up! I need to know how big of an X I can dig up if I bring N number of men with me so I can optimize the split of the treasure. By the way, N can only be greater than 3 and it can only be an odd integer. You better do it quickly or you’ll be sleeping with the fishes!

 

Inputs

1. Number of sailors

The value is >= 3 and is odd

 

Sample Output

Enter the number of sailors: 3 * * * * * * * * *
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT