I need help with a specific part of the javaassignment
This is the part of the assignment that I need the most help on,from the Scrabble class
The text file contains a number of words that are of differentlengths
Here is an example of the words in the file:
Assignment 1 Classes to Implement For this assignment, you must implement two java classes: Tile and Scrabble. Follow the guidelines for each one below. In these classes, you can implement more private (helper) methods if you want to. You may not, however implement more public methods. You may not add instance variables other than the ones specified below nor change the variable types or accessibility (i.e. making a variable public when it should be private). Penalties will be applied if you implement additional instance variables or change the variable types of modifiers from what is described here. CS 1027 Computer Science Fundamentals II 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] Initialize value to " • public Tile(char) [constructor] 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() Returns the tile value
Assignment 1 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] CS 1027 Computer Science Fundamentals II 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 o ** 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?).
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 o **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.
AA AAH AAHED AAHING AAHS AAL AALII AALIIS AALS AARDVARK AARDVARKS AARDWOLF AARDWOLVES
I need help with a specific part of the java assignment This is the part of the assignment that I need the most help on,
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am