Programming Exercise 03 - Math, Random, Enums Authors: Ananay, Owen, Chloe, Ruchi Problem Description Water. Earth. Fire. Air. While the Avatar cycle has seemingly ended, the 4 nations are preparing for war and it is up to you, fellow 1331 student, to help determine who will win! As each nation gathers their armies, the fire nation decides to attack the 3 other nations, forcing the remaining 3 to ally with each other. As all the nations summon heroes to help the m defeat the enemy, and you will have to write a program to determine which army has the strongest support from their heroes. Your assignment will consist of 2 main parts: Determining how many heroes are summoned, which nation they belong to and what statistics they have. Printing out the hero information and averaging it out for the hero's kingdom to see who wins. Some notes for all variables in the assignment: I. When asked to generate a random variable, you must use java.util.Random When asked to generate a floating-point value, round the value to 2 decimal places. You can only use Math.round () to round the value, but remember that you have operators like *,-, and / to help you I. achieve proper rounding. Solution Description 1. Create a public enum called BendingType. a. This special "class" should be defined in a separate file. 2. Populate the enum with the values AIR, WATER, FIRE, EARTH, NON_BENDER. Create a public class called BendingBattlefield 3. Create the main method 5. Inside, create the following variables: 4. An instance of Random named rand, An int called numHeroes and assign to it a random value in the range [50, 100]. A double called boomerangBoost and assign to it a random value in the range [3, 7). а. b. с. Note the interval notation: [a, b] means a number x such that a <= x <= b. (a, b] means a number x such that a < x <= b. [a, b) means a number x such that a <= x < b. (a, b) means a number x such that a < x < b. 6. Create four double variables: averageFirePower, averageFireHealth, averageAlliancePower, and averageAllianceHealth. 7. Print numHeroes with the following format: "Selecting heroes." 8. Create an int named numFire that will keep a running total of the number of heroes belonging to the FIRE nation. 9. Create an int named numAlliance that will keep a running total of the number of heroes belonging to the AIR, WATER, EARTH, Or NON BENDER nations.
Programming Exercise 03 - Math, Random, Enums Authors: Ananay, Owen, Chloe, Ruchi Problem Description Water. Earth. Fire. Air. While the Avatar cycle has seemingly ended, the 4 nations are preparing for war and it is up to you, fellow 1331 student, to help determine who will win! As each nation gathers their armies, the fire nation decides to attack the 3 other nations, forcing the remaining 3 to ally with each other. As all the nations summon heroes to help the m defeat the enemy, and you will have to write a program to determine which army has the strongest support from their heroes. Your assignment will consist of 2 main parts: Determining how many heroes are summoned, which nation they belong to and what statistics they have. Printing out the hero information and averaging it out for the hero's kingdom to see who wins. Some notes for all variables in the assignment: I. When asked to generate a random variable, you must use java.util.Random When asked to generate a floating-point value, round the value to 2 decimal places. You can only use Math.round () to round the value, but remember that you have operators like *,-, and / to help you I. achieve proper rounding. Solution Description 1. Create a public enum called BendingType. a. This special "class" should be defined in a separate file. 2. Populate the enum with the values AIR, WATER, FIRE, EARTH, NON_BENDER. Create a public class called BendingBattlefield 3. Create the main method 5. Inside, create the following variables: 4. An instance of Random named rand, An int called numHeroes and assign to it a random value in the range [50, 100]. A double called boomerangBoost and assign to it a random value in the range [3, 7). а. b. с. Note the interval notation: [a, b] means a number x such that a <= x <= b. (a, b] means a number x such that a < x <= b. [a, b) means a number x such that a <= x < b. (a, b) means a number x such that a < x < b. 6. Create four double variables: averageFirePower, averageFireHealth, averageAlliancePower, and averageAllianceHealth. 7. Print numHeroes with the following format: "Selecting heroes." 8. Create an int named numFire that will keep a running total of the number of heroes belonging to the FIRE nation. 9. Create an int named numAlliance that will keep a running total of the number of heroes belonging to the AIR, WATER, EARTH, Or NON BENDER nations.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Please write in Java code
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 3 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY