va hal Sil te scenar warriors from different races, each with its own attack power and health. Accomplish the following tasks: Display all warriors in the list. Identify and display warriors from the elven race. Calculate the average health of all warriors. Create a frequency distribution of warrior classes in the list. Each element in the distribution should represent the count of warriors belonging to a specific class. Store all the warriors in a Java HashMap, using their names as keys. Output the names of warriors with an attack power above a certain threshold (e.g., attack power > 50). Output the total number of entries in your HashMap. Warriors.txt: "Legolas", Elf, Archer, 80, 120 'Gimli", Dwarf, Warrior, 70, 100 'Aragorn", Human, Swordsman, 90, 150 'Tauriel", Elf, Archer, 75, 110 'Gandalf", Wizard, Sorcerer, 95, 130 "Sauron", Orc, Warlord, 85, 200 "Frodo", Hobbit, Thief, 60, 80
va hal Sil te scenar warriors from different races, each with its own attack power and health. Accomplish the following tasks: Display all warriors in the list. Identify and display warriors from the elven race. Calculate the average health of all warriors. Create a frequency distribution of warrior classes in the list. Each element in the distribution should represent the count of warriors belonging to a specific class. Store all the warriors in a Java HashMap, using their names as keys. Output the names of warriors with an attack power above a certain threshold (e.g., attack power > 50). Output the total number of entries in your HashMap. Warriors.txt: "Legolas", Elf, Archer, 80, 120 'Gimli", Dwarf, Warrior, 70, 100 'Aragorn", Human, Swordsman, 90, 150 'Tauriel", Elf, Archer, 75, 110 'Gandalf", Wizard, Sorcerer, 95, 130 "Sauron", Orc, Warlord, 85, 200 "Frodo", Hobbit, Thief, 60, 80
Chapter3: Using Methods, Classes, And Objects
Section: Chapter Questions
Problem 1GZ
Related questions
Question
Alert ⚠️ You guys use AI tool to answer. Last time I found plagiarism and AI detection in my answer. Now If you will use these things I'll surely give multiple downvotes and will report sure.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 4 images
Knowledge Booster
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.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT