Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Replace the enemy1, enemy2 and enemy3 fields by a single array called enemies. T

ID: 3644496 • Letter: R

Question

Replace the enemy1, enemy2 and enemy3 fields by a single array called enemies. Throughout your Game, each time you refer to one of the fields enemy1, enemy2 or enemy3, replace that reference to the field by a reference to a particular position in the enemies array. For example, whenever you refer to enemy1, you should refer to enemies[0] instead. In order to avoid a NullPointerException, you must also create the enemies array in the constructor before you attempt to store enemies into it. Notice that the Game constructor now reads the number of enemies from the user and stores this into a local variable numEnemies. Modify your constructor so that it no longer creates 3 enemies, but instead creates however enemies the user requested, according to the number that is stored in the local variable numEnemies.

Explanation / Answer

the questionis too big making it difficult for us to answer please re post the question properly thank you