subject

Imagine you're developing a Pokemon game, and you need to implement the battle party mechanic. Recall that the player's party can hold at most 6 Pokemon. To simplify things, you want to implement it as an ArrayList containing 6 elements (1 for each Pokemon in the party), and to simplify things even further, you decide to avoid making a custom Pokemon class. Instead, you choose to represent each Pokemon as a HashMap containing two keys: "Name" and "Level". The value associated with the key "Name" will be a String denoting the Pokemon's name, and the value associated with the key "Level" will be an Integer denoting the Pokemon's level. TASK: Write a public static method called createParty that has one parameter of type String[] called names containing the Pokemon names, followed by a parameter of type int[] called levels containing the Pokemon levels (where names[i] and levels[i] are the name and level of Pokemon i in the party). It should return the party as a ArrayList> as described above HINT: Each Pokemon would be its own HashMap, and each of these HashMaps has exactly two keys, both of which are Strings: "Name" and "Level" Sample Input: Pikachu Venusaur Charizard Blastoise Lapras Snorlax 88 84 84 84 80 82 Sample Output: Pikachu 88 Venusaur 84 Charizard 84 Blastoise 84 Lapras 80 Snorlax 82 Write a program, test using stdin β†’ stdout

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:40
Gabe wants to move text from one document to another document. he should copy the text, paste the text, and open the new document highlight the text, select the cut command, move to the new document, make sure the cursor is in the correct location, and select the paste command select the save as command, navigate to the new document, and click save highlight the text, open the new document, and press ctrl and v
Answers: 1
question
Computers and Technology, 23.06.2019 01:10
Problem 1 - hashing we would like to use initials to locate an individual. for instance, mel should locate the person mark e. lehr. note: this is all upper case. generate a hash function for the above using the numbers on your telephone. you know, each letter has a number associated with it, so examine your telephone keypad. generate 512 random 3 letter initials and take statistics on a linked list array size 512 to hold this information report how many have no elements, 1 element, 2 elements, does this agree with the hashing statistics distribution?
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
question
Computers and Technology, 23.06.2019 11:00
Sports and entertainment class, your goal is to increase attendance and make a profit for a game by getting your team on a winning track with total salaries less than $3,000,000
Answers: 3
You know the right answer?
Imagine you're developing a Pokemon game, and you need to implement the battle party mechanic. Recal...
Questions
question
Mathematics, 20.11.2020 20:50