Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java program for beginners need comments (its important) and output Problem definition 2. Create one dimensional aray for trees where indes is tree number and

Java program for beginners need comments (its important) and output image text in transcribed
Problem definition 2. Create one dimensional aray for trees where indes is tree number and value ig mumber of acoms at You wil define "umber of chip monks and number of bees. There w.bearendom number of on each tree. You will pick one chip monk (say chip monk 0 in arrav) and make him your chip monk On each loop of the game you will select which tree yeu will go bo. All other chip monks will go to redern selected tree wide at . bee vou wa first try to pve every chip monk 4 acorns " the" ' enough acorns for every chip monk to get 4 you will find the largest intreger that all chip monks can get that many acorms If there are fewer scoms than chip monks you start with the lowest number chip monk and give him one com and preceed until all the acorns are gone The ganse is over-all acovs tom all the trees oregone number of scorns chip monk has. 4 for each tree randomly ig number acorns per tree putting value in array between O and 40 a Need know total acorns to know when to stop so add number acores each tree to wariable. Then during gene subtract as each chip monk gets acon the other chip monks s create a sooo to let che mordept acormbeamthere-re acornsleft Specif cally a Ask which tree you want your chip monk to go to b For each chip monk randomly ure out which tree they are going to c Save the tree sumber in another armay with indes being which number dhip mosk The game will start where you will deine the number of chio monks and the number of tree acoms on them The game will un until there are ne more acorns avalable . The game willign e randon mumber ol acoms per tree between sero and 0 b infeger divide the umber of chip monks into the number of cons left The game will ask you which tree you went your chip monk to go bo The game will select at random which tree each other chip monk wit go to The maximum sumber of acorm s chip monk can cerry is4 "ther" carry 4, en each chip mork will get the same number of aco there wn mityle dep monks and not esgh aterns fu" each chip morn toget one .. then ive one acorm to as many dhip monks as you c ting wth west mumber chig monk The output will show each chig monk and how many cerns they picked s it will compare that to your thip monk and let you know i you picked up more acoms thas the other chie monks ifthe umber nteger) s greater than 3 go through aray and find each chip monks eving them 4 aconns and add mamber chip conks tmes 4 to umber of cores pessed and subtract multu e chs atthe same tree and est enough acomfur every cho monk to . them that umber acorns and ald that number to cos pessed out and sract fom " @nureer acorns at. reenaero skipover noecores to ass.n sero done ese go to nest lowest number chip mosk and give i HINT: pretend you have 3 chip monks and 3 trees and wak through a couple loops of the getting acons Draw out on piece peger the hip monks and trees with acoms on tres Print out each chip monk and number acoms they collected Aso prist out if your chip moni collected more acorns the other chip monks The following is one possible logical approach to the problem 1 Read in number of chip monks and number of tre Problem definition 2. Create one dimensional aray for trees where indes is tree number and value ig mumber of acoms at You wil define "umber of chip monks and number of bees. There w.bearendom number of on each tree. You will pick one chip monk (say chip monk 0 in arrav) and make him your chip monk On each loop of the game you will select which tree yeu will go bo. All other chip monks will go to redern selected tree wide at . bee vou wa first try to pve every chip monk 4 acorns " the" ' enough acorns for every chip monk to get 4 you will find the largest intreger that all chip monks can get that many acorms If there are fewer scoms than chip monks you start with the lowest number chip monk and give him one com and preceed until all the acorns are gone The ganse is over-all acovs tom all the trees oregone number of scorns chip monk has. 4 for each tree randomly ig number acorns per tree putting value in array between O and 40 a Need know total acorns to know when to stop so add number acores each tree to wariable. Then during gene subtract as each chip monk gets acon the other chip monks s create a sooo to let che mordept acormbeamthere-re acornsleft Specif cally a Ask which tree you want your chip monk to go to b For each chip monk randomly ure out which tree they are going to c Save the tree sumber in another armay with indes being which number dhip mosk The game will start where you will deine the number of chio monks and the number of tree acoms on them The game will un until there are ne more acorns avalable . The game willign e randon mumber ol acoms per tree between sero and 0 b infeger divide the umber of chip monks into the number of cons left The game will ask you which tree you went your chip monk to go bo The game will select at random which tree each other chip monk wit go to The maximum sumber of acorm s chip monk can cerry is4 "ther" carry 4, en each chip mork will get the same number of aco there wn mityle dep monks and not esgh aterns fu" each chip morn toget one .. then ive one acorm to as many dhip monks as you c ting wth west mumber chig monk The output will show each chig monk and how many cerns they picked s it will compare that to your thip monk and let you know i you picked up more acoms thas the other chie monks ifthe umber nteger) s greater than 3 go through aray and find each chip monks eving them 4 aconns and add mamber chip conks tmes 4 to umber of cores pessed and subtract multu e chs atthe same tree and est enough acomfur every cho monk to . them that umber acorns and ald that number to cos pessed out and sract fom " @nureer acorns at. reenaero skipover noecores to ass.n sero done ese go to nest lowest number chip mosk and give i HINT: pretend you have 3 chip monks and 3 trees and wak through a couple loops of the getting acons Draw out on piece peger the hip monks and trees with acoms on tres Print out each chip monk and number acoms they collected Aso prist out if your chip moni collected more acorns the other chip monks The following is one possible logical approach to the problem 1 Read in number of chip monks and number of tre

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

2. What, according to Sergey, was strange at this meeting?

Answered: 1 week ago

Question

3. Are our bosses always right? If not, what should we do?

Answered: 1 week ago