package sandbox.prompts;
import sandbox.prompts.PromptInRange;
import java.util.Scanner;
public class PromptTest
{
public static void displayInput( int i )
{
System.out.println("You typed " + i + ".");
}
public static void main( String[] args )
{
Scanner user_input = new Scanner(System.in);
int i;
i = PromptInRange.promptWholeNumber();
displayInput(i);
i = PromptInRange.promptIntInRange(5, 10);
displayInput(i);
i = PromptInRange.promptIntInRange(5, 10, "Read the prompt, doofus!");
displayInput(i);
i = PromptInRange.promptIntInRange(5, 10, "Less than minimum.", "Greater than max.");
displayInput(i);
}
}
Comments