analysis.java
Class KeyboardInput

java.lang.Object
  |
  +--analysis.java.KeyboardInput

public class KeyboardInput
extends java.lang.Object

Class to handle keyboard input. Can prompt for user input; convert input string into numbers; and picks up conversion errors.


Constructor Summary
KeyboardInput()
          Creates a keyboardInput object that handles prompting and conversion of keyboard input.
 
Method Summary
 double getDouble()
          Extracts a double precision number from the keyboard input.
 float getFloat()
          Extracts a floating point number from the keyboard input.
 int getInt()
          Extracts an integer number from the keyboard input.
 java.lang.String getString()
          Extracts a String from the keyboard input.
 void prompt(java.lang.String promptText)
          Prompts the user to type in something from the keyboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyboardInput

public KeyboardInput()
Creates a keyboardInput object that handles prompting and conversion of keyboard input.

Method Detail

prompt

public void prompt(java.lang.String promptText)
Prompts the user to type in something from the keyboard.

Parameters:
promptText - Message to prompt input with.

getInt

public int getInt()
Extracts an integer number from the keyboard input.

Returns:
Integer value extracted from keyboard input.

getFloat

public float getFloat()
Extracts a floating point number from the keyboard input.

Returns:
Floating point value extracted from keyboard input.

getString

public java.lang.String getString()
Extracts a String from the keyboard input.

Returns:
String extracted from keyboard input.

getDouble

public double getDouble()
Extracts a double precision number from the keyboard input.

Returns:
Double precision value extracted from keyboard input.