JAVA! Here\'s what output should look like. import java.util.Random; import java
ID: 3599850 • Letter: J
Question
JAVA! Here's what output should look like.
import java.util.Random;
import java.util.Scanner;
public class MineSweeper {
/**
* This is the main method for Mine Sweeper game!
* This method contains the within game and play again loops and calls
* the various supporting methods.
*
* @param args (unused)
*/
public static void main(String[] args) {
//FIX ME
}
/**
* This method prompts the user for a number, verifies that it is between min
* and max, inclusive, before returning the number.
*
* If the number entered is not between min and max then the user is shown
* an error message and given another opportunity to enter a number.
* If min is 1 and max is 5 the error message is:
* Expected a number from 1 to 5.
*
* If the user enters characters, words or anything other than a valid int then
* the user is shown the same message. The entering of characters other
* than a valid int is detected using Scanner's methods (hasNextInt) and
* does not use exception handling.
*
* Do not use constants in this method, only use the min and max passed
* in parameters for all comparisons and messages.
* Do not create an instance of Scanner in this method, pass the reference
* to the Scanner in main, to this method.
* The entire prompt should be passed in and printed out.
*
* @param in The reference to the instance of Scanner created in main.
* @param prompt The text prompt that is shown once to the user.
* @param min The minimum value that the user must enter.
* @param max The maximum value that the user must enter.
* @return The integer that the user entered that is between min and max,
* inclusive.
*/
public static int promptUser(Scanner in, String prompt, int min, int max) {
return -99; //FIXME
}
/**
* This initializes the map char array passed in such that all
* elements have the Config.UNSWEPT character.
* Within this method only use the actual size of the array. Don't
* assume the size of the array.
* This method does not print out anything. This method does not
* return anything.
*
* @param map An allocated array. After this method call all elements
* in the array have the same character, Config.UNSWEPT.
*/
public static void eraseMap(char[][] map) {
return; //FIXME
}
/**
* This prints out a version of the map without the row and column numbers.
* A map with width 4 and height 6 would look like the following:
* . . . .
* . . . .
* . . . .
* . . . .
* . . . .
* . . . .
* For each location in the map a space is printed followed by the
* character in the map location.
* @param map The map to print out.
*/
public static void simplePrintMap(char[][] map) {
return; //FIXME
}
Config.java below:
public class Config {
/**
* The minimum and maximum size, inclusive, for the width and height of the map.
*/
public static final int MIN_SIZE = 3;
public static final int MAX_SIZE = 20;
/**
* Constants with characters showing the status of different locations on the map
*/
public static final char HIDDEN_MINE = '*'; // at end of game, show a hidden mine
public static final char SWEPT_MINE = '@'; // at end of game, show swept/exploded mine
public static final char UNSWEPT = '.';
}
Explanation / Answer
package com;
public class ArraySortedPolynomial implements PolynomialInterface
{
ArraySortedPolynomial()
{
}
ArraySortedPolynomial(String pol)
{
}
@Override
public PolynomialInterface add(PolynomialInterface other) {
// TODO Auto-generated method stub
return null;
}
@Override
public PolynomialInterface subtract(PolynomialInterface other) {
// TODO Auto-generated method stub
return null;
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.