Tile.java This class represents a single Scrabble tile that will be used in the game. The class must have the following

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Tile.java This class represents a single Scrabble tile that will be used in the game. The class must have the following

Post by answerhappygod »

Tile Java This Class Represents A Single Scrabble Tile That Will Be Used In The Game The Class Must Have The Following 1
Tile Java This Class Represents A Single Scrabble Tile That Will Be Used In The Game The Class Must Have The Following 1 (94.22 KiB) Viewed 35 times
Tile Java This Class Represents A Single Scrabble Tile That Will Be Used In The Game The Class Must Have The Following 2
Tile Java This Class Represents A Single Scrabble Tile That Will Be Used In The Game The Class Must Have The Following 2 (163.9 KiB) Viewed 35 times
Tile.java This class represents a single Scrabble tile that will be used in the game. The class must have the following private variables: value (char) The class must have the following public methods: • public Tile() [constructor] o Initialize value to " ● • public Tile(char) [constructor] o Initialize value to the given argument • public void pickup() o Generate a random character between A and Z (inclusive) and set the value to that letter. o Feel free to use ‘java.util.random' for this method • public char getValue() O Returns the tile value
Scrabble.java This class represents the Scrabble game in which there are seven randomly selected tiles, and scoring is performed for each possible word (this will be the tougher class to implement). The class must have the following private variables: • tiles (Tile[]) The class must have the following public methods: • public Scrabble() [constructor] o Initialize the Tile array and 'pickup' for random values • public Scrabble(Tile []) [constructor] o Initialize the tile array with the given argument • public String getLetters() o Return a string that is all of the tile characters (for example, "ABFEODL") • public ArrayList<String> getWords() o Create an ArrayList of Strings with n elements. Each element should represent a word that can be created using the current tiles. o The algorithm for this method should reference the provided file CollinsScrabbleWords2019.txt ** do NOT put this file somewhere on your local machine and hardcode the local directory. This will likely cause your tests to fail on GradeScope. Also, do not put it within a folder in the relative path. • public int[] getScores() o Create an int array with n elements. Each element in this list should represent each individual score for each word that can be created using the current tiles. This should be returned in ascending order. • public Boolean equals(Scrabble) o Compare the given Scrabble object from the argument with the 'this' object to see if they are equal (do they have the same tiles?).
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply