Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this assignment, you will be building a class, creating objects, doing comparisons and doing some calculations. You need to remember what you have learned

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
For this assignment, you will be building a class, creating objects, doing comparisons and doing some calculations. You need to remember what you have learned in class, lab, books and your assignments. Be sure to refer to them when you need to For this assignment, you will use the following: String operations Classes and Objects Methods Math operations . There are 2 parts to this assignment. In the first part, you are going to be given a problem and you will then need to create a structure and write algorithms to solve it. In the second part, you'll be turning this algorithm into a java program. So let's get started! Part 1: Your Butterflies vs Bees Contest! During the pandemic, your little sister hasn't had any friends to play with... except you! Although you dearly love your little sister, she is driving you a bit crazy. She follows you everywhere and all she wants to do is dress you up, put bows in your hair and then put a picture of the result on Facebook. Lucky you, your friends and family think its hilarious! You, not so much. You decide that she needs something more to do, so you are going to make a game for her. You've got it! She loves both butterflies and honey bees, so you are going to make a pollen-collecting contest that your sister can play against the computer The game will have 4 types of information you need to keep track of the user, the Butterflies, the Bees and the Flowers. Here's what you need to know for cach (hints some of these can be passed/given to the class constructor): Human User/Player Name - You'll need to ask who is going to play the game Whether they want to be a butterfly or bee Butterflies 6 Butterfly colony name. Every colony needs a name, right? So you'll need to ask the user what the name of the butterfly colony is. Butterfly color - Butterflies come in many different colors. To make things simpler, your colony will start with butterflies that only have two colors, a main color and accent color. You'll want to integrate the colors into the butterfly colony name. So you'll need to ask the user about which colors they want. . o Colony starting size - How many butterflies is the colony starting out with? This can vary, so you better ask the user about that also o Carry capacity - Butterflies come in different sizes. So we need to know how much pollen each butterfly can carry, from 1 - 10 grams. Users won't know this information, so we'll need to generate it Bees o Bee colony name - Every colony needs a name, right? So you'll need to ask the user what the name of the bee colony is o Colony starting size - How many bees is the colony starting out with? This can vary, so you better ask the user about that also. o Carry capacity - Bees come in different sizes. So we need to know how much pollen each bee can carry, from 3 - 7 grams. Users won't know this information, so we'll need to generate it. Flower Flower name/type - We'll need to ask the user what types of flowers to use in the contest. (eg., Rose, Lily, etc.) o Color - Every flower has a color, so ask the user what color the flower should be Distance from colonies - Each flower is a different distance from the colonies, 1 - 5 miles. The user won't know this, so we'll have to generate it. Round - Which round the flower was used in (see below). Here is the flow of the game and the things that can be done with the game: (hint: Do not assume that these must be methods. Think about how they will be used then decide) User Information - Start by asking the user for their name and whether they want to be on team butterflies or team bees Colony Information - Ask the user for names of the butterfly and bee colonies, the colors of the butterflies, and the starting size of the butterfly and bee colonies Flower Information - Ask the user for the names, colors and distance of 3 flowers they want used in the contest 3 Rounds - There will be 3 rounds where in each round, one butterfly and one bee will race to the selected flower, grab as much nectar as they can carry, and race back to the colony. At the colony, the nectar will be put into a collective pot for each colony. Nectar Loss - As the butterflies and bees fly back with their colony. they lose some of the nectar that they have picked up. How much they lose depends on how far they have to fly. For every mile they have to fly, they lose 5% of the nectar that they are carrying. For example, if they have to fly 3 miles, then when they have reached the colony, they will have lost 15% of their nectar Each Round - For each round, the user should be told the following: ar . . Round number o Which flower (including its color) the butterflies (the integrated name as discussed above) and bees are racing to o The distance to the flower o The carrying capacity of the butterfly and bee o How much nectar made it back to the colony o The amount of nectar in each colony's collective pot at the end of that round Ending colony size - At the end of the 3 rounds, you'll determine who wins and calculate the ending colony sizes. o Whichever colony's collective pot has the most nectar wins. For the winning colony, the colony triples in size. For full credit, you must use the appropriate math function. For the losing colony, the colony loses 10% of its population Winning Output - For your last output (nicely formatted in a JOptionPane), you will want to include: o Whether the user's team won or lost (including the user and colony name) o For both teams The starting size Total carrying capacity Total distance flown Total amount of pollen collected The ending size O . . . For this program, you'll 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 play again?" You will only ask them ONCE for the needed information and then tell them how the game is progressing. lanrithms for your program, and then do o Which flower (including its color) the butterflies (the integrated name as discussed above) and bees are racing to o The distance to the flower o The carrying capacity of the butterfly and bee o How much nectar made it back to the colony o The amount of nectar in each colony's collective pot at the end of that round Ending colony size - At the end of the 3 rounds, you'll determine who wins and calculate the ending colony sizes. o Whichever colony's collective pot has the most nectar wins. For the winning colony, the colony triples in size. For full credit, you must use the appropriate math function. For the losing colony, the colony loses 10% of its population Winning Output - For your last output (nicely formatted in a JOptionPane), you will want to include: o Whether the user's team won or lost (including the user and colony name) o For both teams The starting size Total carrying capacity Total distance flown Total amount of pollen collected The ending size O . . For this program, you'll 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 play again?" You will only ask them ONCE for the needed information and then tell them how the game is progressing. lanrithms for your program, and then do The game will have 4 types of information you need to keep track of the user, the Butterflies, the Bees and the Flowers. Here's what you need to know for each (hint: some of these can be passed/given to the class constructor): Human User/Player o Name - You'll need to ask who is going to play the game o Whether they want to be a butterfly or bee Butterflies o Butterfly colony name - Every colony needs a name, right? So you'll need to ask the user what the name of the butterfly colony is. o Butterfly color - Butterflies come in many different colors. To make things simpler, your colony will start with butterflies that only have two colors, a main color and accent color. You'll want to integrate the colors into the butterfly colony name. So you'll need to ask the user about which colors they want. For this assignment, you will be building a class, creating objects, doing comparisons and doing some calculations. You need to remember what you have learned in class, lab, books and your assignments. Be sure to refer to them when you need to For this assignment, you will use the following: String operations Classes and Objects Methods Math operations . There are 2 parts to this assignment. In the first part, you are going to be given a problem and you will then need to create a structure and write algorithms to solve it. In the second part, you'll be turning this algorithm into a java program. So let's get started! Part 1: Your Butterflies vs Bees Contest! During the pandemic, your little sister hasn't had any friends to play with... except you! Although you dearly love your little sister, she is driving you a bit crazy. She follows you everywhere and all she wants to do is dress you up, put bows in your hair and then put a picture of the result on Facebook. Lucky you, your friends and family think its hilarious! You, not so much. You decide that she needs something more to do, so you are going to make a game for her. You've got it! She loves both butterflies and honey bees, so you are going to make a pollen-collecting contest that your sister can play against the computer The game will have 4 types of information you need to keep track of the user, the Butterflies, the Bees and the Flowers. Here's what you need to know for cach (hints some of these can be passed/given to the class constructor): Human User/Player Name - You'll need to ask who is going to play the game Whether they want to be a butterfly or bee Butterflies 6 Butterfly colony name. Every colony needs a name, right? So you'll need to ask the user what the name of the butterfly colony is. Butterfly color - Butterflies come in many different colors. To make things simpler, your colony will start with butterflies that only have two colors, a main color and accent color. You'll want to integrate the colors into the butterfly colony name. So you'll need to ask the user about which colors they want. o Which flower (including its color) the butterflies (the integrated name as discussed above) and bees are racing to o The distance to the flower o The carrying capacity of the butterfly and bee o How much nectar made it back to the colony o The amount of nectar in each colony's collective pot at the end of that round Ending colony size - At the end of the 3 rounds, you'll determine who wins and calculate the ending colony sizes. o Whichever colony's collective pot has the most nectar wins. For the winning colony, the colony triples in size. For full credit, you must use the appropriate math function. For the losing colony, the colony loses 10% of its population Winning Output - For your last output (nicely formatted in a JOptionPane), you will want to include: o Whether the user's team won or lost (including the user and colony name) o For both teams . The starting size Total carrying capacity Total distance flown Total amount of pollen collected The ending size O . For this program, you'll 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 play again?" You will only ask them ONCE for the needed information and then tell them how the game is progressing. lanrithms for your program, and then do Program would ask the player for a name and whether they wanted to be a bee or butterfly. 2. An ELSE IF statement would be used to switch between the two options 3. If a butterfly is chosen then the colony name and butterfly color would be gained directly from the player. 4. The colony starting size would also be asked. 5. Carrying capacity will be randomly generated 6. If the player choses bees instead the ELSE IF statement will ask for the bees colony name And starting size 7. The bees carrying capacity will be generated with a random generator 8. User will also be asked what type and color of flower 9. Random generator will generate distance of flower 10. Rounds will be calculated and presented 11.5% of nectar will be lost per mile while in flight 12.After round players will be presented with a round result. 13. Ending colony size will be calculated after 3 rounds 14. Winning colony grows 3 times and loses 10% of the population 15. All results will be presented including winning results, ending size distance flown carrying capacity, and starting capacity

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

1. What is the role of U.S. banks in international banking?

Answered: 1 week ago