Question: I need help writing a java pseudocode to make a beefarm Your little sister has decided that she wants a pet. You love animals and
I need help writing a java pseudocode to make a beefarm
Your little sister has decided that she wants a pet. You love animals and want to further engender her love of animals, but, well, her last pet, goldie the goldfish, didnt fare too well. So you went on the hunt for a different kind of pet that will fit the bill. Much to your joy, you have found the perfect pet for her a Bee farm! They are easy to take care of and dont die off too quickly. Now all that you have to do is build a caretaker program so that she can easily take care of her Bees and see how they thrive (or not!).
Heres what you need for the Bee farm (hint: these can be be passed/given to the class constructor if you want to challenge yourself):
Queens name Every Bee colony has a queen, and every queen has a name. So youll need to ask the user what they want to name their queen Bee.
Colony name Every pet needs a name, right? So youll need to ask the user what the name of their colony is.
Caretaker name Youll need to ask who the colonys mom/dad is.
Starting size How many Bees is the colony starting out with? This can vary, so you better ask the user about that also.
These are the things that can be done with the Bee farm:
(hint: Do not assume that these must be methods. Think about how they will be used and then decide)
Feed Like all pets, Bees get hungry. In our case, though, only when the queen is going to breed. Fortunately, with the program you are building, you can ask the user how many days their colony should be fed and then check to make sure they have enough food for the queen to breed and have babies (they need 1 day of food for each time she breeds).
Breed Other than eating, queen Bees dont do much else but breed and have babies. Youll want to be sure she has some entertainment, so youll need to ask your user if they want to breed their queen Bee and, if so, how many times. For each time she successfully breeds and has babies, the colony triples in size. (hint: re-read about feeding). Note: As you are not required to use loops, you may limit the number of times the queen breeds to 10 if you cant figure out another way of doing this (also see lifespan below).
Harvest You love the bees, but especially love that they make honey. Youll want to be sure that you harvest your honey. First, the bees only produce honey if they have been fed appropriately. For every ounce of honey, the bees need to have been fed for two days.
Lifespan Although we love our Bees, they dont always live very long. In fact, the colony depends on the life of the queen. Queens can only live about 10days. So if the caretaker gives the colony food for more than 10 days, the queen will die. If that happens, then 50% of the Bees will die.
Expand Colony Additional hives can be added to the Bee farms, allowing the Bees to expand the colony. Ask your user if they want to add an additional hive.
If the colony IS expanded, there is a 70% chance that a new queen will be born.
If the colony IS NOT expanded, there is a 20% chance that a new queen will be born.
(hint: you can use the random number generator from Assignment 1 to help you with this)
New Queen - If a new queen is born, the new queens name will be the name of the original queen with 2.0 added to the end of the name.
For this program, youll want to ask your user about any pertinent information up front. Do not worry about having any loops to ask them things like Do you want to feed your colony again? You will only ask them ONCE for the needed information and then tell them how their colony is doing.
For your output (nicely formatted in a JOptionPane), you will want to include:
Caretaker Name
Bee Colony Name
Queens Name
Starting Size
How many days they were fed
Requested number of times to breed
How many times they successfully bred
How much honey you could harvest
Whether the queen got sick and how many died
Whether the colony was expanded
Whether a new queen was born and what her name is
Final number of Bees in the colony
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
