Question: short application that prints (a) 11. 138 points] Method design: The following output shows a fotal porwer of all Avenger members (b) alphabetical sorting (e)
short application that prints (a) 11. 138 points] Method design: The following output shows a fotal porwer of all Avenger members (b) alphabetical sorting (e) finding a specific name generate the same output a. Define printTeam method to print an array of Avenger names and their powers. b. Define sum method to add all powers of Avenger members e Define insertionSortstring method to sort names based on alphabetical order d. Define binarySearchString method to find a name of any Avenger, If found, returning the correct index. If not, display-1 The total team power is 34.e After applying Insertion sorting based-on alphabetical order; Black widow, 8.e Hulk, 1e.e Ironman, 3.e Spiderman, 6.e Thor, 7.e call binarysearchstring method to find whether any Avenger possess a name Thor' If found, returning the correct index. If not, display -1. Result: 4 public class GroupPower2_String f public static void main(String[] args) f Avengers[] team { new Avengers ("Ironman", 3), new Avengers ("Hulk", 10), new Avengers( Thor",7), new Avengers("Spiderman", 6), new Avengers( "Black Widow", 8)j; System.out.println("The total team power is "sum(team)) System.out.println(" After Bubble sorting by alphabetical order -- insertionsortstring(team); printTeam (team); System.out.println("InCall binarySearchString method to find" + "whether any Avenger possess a name Thor; +"If not, display -1. Inlt Result: ; System.out.print(" If found, returning the correct index." int foundIndexe2 binarysearchString(team, "Thor") System.out.printin(foundIndexez)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
