Question: In java please import java.util.Arrays; import java.util.Random; import java.util.Scanner; /** * TODO Write a summary of the role of this class in the * MasterMind
In java please
import java.util.Arrays; import java.util.Random; import java.util.Scanner;
/** * TODO Write a summary of the role of this class in the * MasterMind program. public class MasterMind {
/** * Prompts the user for a string value by displaying prompt. * Note: This method should not add a new line to the output of prompt. * * After prompting the user, the method will read an entire line of input and remove * leading and trailing whitespace. If the line equals the single character '?' * then return null. If the line is a valid code (determine with isValidCode) return * the code, otherwise print "Invalid code." and prompt again. * * @param input The Scanner instance to read from System.in * @param prompt The user prompt. * @param numPositions The number of code positions. * @param symbols The valid symbols. * @return Returns null or a valid code. */ public static char[] promptForGuess(Scanner input, String prompt, int numPositions, char[] symbols) { return null; //TODO replace }
how do I write the above method to fit the parameters?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
