***Listing 1: Game skeleton class public class Game { //A 2D array data structure to store the survey record private String[][] games={ {Chris, Hellblade: Senua's
***Listing 1: Game skeleton class
public class Game { //A 2D array data structure to store the survey record private String[][] games={ {"Chris", "Hellblade: Senua's Sacrifice"}, {"Ali", "Wolfenstein II: The New Colossus"}, {"Ramesh", "Horizon: Zero Dawn"}, {"Saimad", "Divinity: Original Sin II"}, {"Mei Mei", "Divinity: Original Sin II"}, {"Susan", "Super Mario Odyssey"}, {"Michael", "Horizon: Zero Dawn"}, {"Jackson", "Wolfenstein II: The New Colossus"}, {"John", "Super Mario Odyssey"}, {"Malik", "Resident Evil 7: Biohazard"}, {"Lakshmy", "Super Mario Odyssey"}, {"Howard", "Super Mario Odyssey"}, {"Samuel", "Resident Evil 7: Biohazard"}, {"Rahim", "Resident Evil 7: Biohazard"}, {"Suraya","Persona 5"}, {"Jackie","The Legend of Zelda: Breath of the Wild"} }; /** * Returns the number students play the "game" */ public int countGame(String game){ //Write your code here } /* * Prints the number and list of students playing "game" */ public void getStudents(String game){ //Write your code here } /* * Returns TRUE if "newGame" successfully replaces the game played by "student" in the 2D array. * Otherwise FALSE */ public boolean updateGame(String student, String newGame){ //Write your code here } /* * Prints the entire list of students and games from the "games" array */ public void displayAll(){ //Write your code here } }//end class
***Listing 2: GameChecker skeleton class
public class GameChecker { public static void main(String args[]){ //Create an instance of Game class //Write codes to test all the methods in Game class //5 sample test output are provided in Figure 1-5 } }//end class
In a hypothetical survey conducted at the WOU campus, a group of students has identified their favourite online games. The results are tabulated in Table 1. In this mini project, you are required to develop a Java program which can perform simple manipulations on the survey results Student Online Game Iblade Wolfenstein II: The New Colossus Tis s Sacrifice Ali Ramesh Horizon: Zero Dawn Saimad Divinity: Original Sin II Mei Mei Divinity: Original Sin II SusanSuper Mario Odyssey Michael Horizon: Zero Dawn Jackson Wolfenstein II: The New Colossus John Malik LakshmySuper Mario Odyssey Howard Super Mario Odyssey Samuel Resident Evil 7: Biohazard Rahim Resident Evil 7: Biohazard Suraya Persona 5 Jackie Super Mario Odyssey Resident Evil 7: Biohazard The Legend of Zelda: Breath of the Wild Table 1: Survey results of WOU students' favourite online games The skeleton program is given as Game class and GameChecker class. You must implement the missing methods based on the code descriptions (see Listing 1, Game ) and hints from the sample execution outputs (see Figure 1). Finally, create an instance of Game from GameChecker to test all its methods (see Listing 2, GameChecker). As you notice, the results in Table 1 have been stored as a two-dimensional array of String named games in Game class Marks will be awarded for the following effort: Java Implementation 20 marks 20 marks 20 marks 20 marks 20 marks ass Game countGame() getStudents() replaceGame () displayA1l() Provide tests for all methods in the Game class GameCheckerStep by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started