Question: how would I create a hero, party, and a party test class and also add the following discriptioH The Party class contains an array of

how would I create a hero, party, and a party test class and also add the following discriptioHhow would I create a hero, party, and a party test classand also add the following discriptioH The Party class contains an arrayof Hero's to manage the current party. Implement the Party class according

The Party class contains an array of Hero's to manage the current party. Implement the Party class according to the following UML diagram: . Party Data fields -Heroes: Hero[3] Contains the Hero's in the current party. Methods +Party Initialize the empty Hero array to hold 3 Hero's. +addHero/index: int, hero: Hero) : void Add a Hero to the current party at the given index. If there is an existing Hero at the index, replace it. +removeHero(index: int) :Hero Remove and return the Hero from the given index (set the array index to null to remove). Return the Hero of the desired index. +getHero(index: int) :Hero +gainExperience(experience: int) Increase the experience of all the Hero's in the Party. Hint: Use each Hero's gainExperience method +toString :String Print out the current Party's data. Hint: Use each Hero's toString method. Hero Data fields -name : String -hClass: String -level: int -experience: int -MAX LEVEL: int Contains the name of the Hero Contains the class of the Hero (Be careful, class is a java keyword!) Contains the level of the Hero Contains the experience of the Hero Constant static int containing the max level possible. Set it to 10. Constant static int array containing the numbers {5, 10, 15, 20, 30, 40, 50, 75, 100}. These are the experience amounts required to proceed from level 1 to 2 (5 experience), 2 to 3 (10 experience), etc. up to max level. -LEVELS: int[10] Methods +Hero (name: String) Set the name to given value and set class to empty String, level to 1, and experience to 0. +Any accessor methods you need Return the name, class, or level. +Any mutator methods you need Set the name, class, or level. +setRandomLevel Set the level to a random level between 1 and 10. : void +gainExperience(experience: int) :void Increase the experience of the Hero. If the experience reaches or passes the maximum for the Hero's current level, increase the level by 1, reset experience to 0, and add any "leftover experience. +toString0 :String Return a String containing the information about the hero such name, class, level, experience. Make it easily readable when printed using newline and/or tab characters. Student Data fields -name: String -grade: char -average: double -scores[5]: int Methods Constructor(s) Store the name of student Store the letter grade Store the average score Store the five exam scores Accessor methods if needed Modifier methods if needed +calculate Average(): void Determine the average of the five test scores for each student +calculateGrade(): void Determine each student's letter grade based on 90-100 A, 80-89 B, 70-79 C, 60-69 D, 0-59 F +generateOutput(Print Writer outFile): void Print out name, test scores, average, and letter grade to the output file Implement GradeAnalyzer class with the following description. The GradeAnalyzer class: . . Contains a Student object array that can hold up to 30 students. Uses Scanner and PrintWriter. Reads in the text file student_grades.txt" that includes student data for constructing Student objects. A sample "students_grades.txt file is attached to this lab on Brightspace and can be used for testing. Computes the average and letter grade for each student. Write student name, test scores, average, and letter grade to the output file "student_grade_report.txt". O

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!