ALGORITHM DEVELOPMENT CS 139
Popular in Course
Popular in ComputerScienence
This 1 page Class Notes was uploaded by Mable Windler on Saturday September 26, 2015. The Class Notes belongs to CS 139 at James Madison University taught by Mohamed Aboutabl in Fall. Since its upload, it has received 8 views. For similar materials see /class/214130/cs-139-james-madison-university in ComputerScienence at James Madison University.
Reviews for ALGORITHM DEVELOPMENT
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 09/26/15
Keyboard c s l A public class derived from Obj ect which provides various static methods for obtaining user input from the keyboard standard input Problems encountered during the reading process including format errors are handled internally and default values are returned Error messages indicating these problems are printed to standard output by default but may be repressed Methods public static String readString Reads and returns a string to the end of the line from standard input public static String readWord Reads and returns one spacedelimited word from standard input public static boolean readBoolean Reads and returns a boolean value from standard input Returns false if an exception occurs during the read public static char readChar Reads and returns a character from standard input Returns MINiVALUE if an exception occurs during the read public static int readlnt Reads and returns an integer value from standard input Returns MINiVALUE if an exception occurs during the read public static long readLong Reads and returns a long integer value from standard input Returns MINiVALUE if an exception occurs during the read public static float readFloat Reads and returns a oat value from standard input Returns NaN if an exception occurs during the read public static double readDouble Reads and returns a double value from standard input Returns NaN if an exception occurs during the read public static int getErrorCountO Returns the number of errors recorded since the Keyboard class was loaded or since the last error count reset public static void resetErrorCount int count Resets the current error count to zero public static boolean getPrintErrors Returns a boolean indicating Whether input errors are currently printed to standard output public static void setPrintErrors boolean flag Sets the boolean indicating Whether input errors are to be printed to standard input Program Demonstrating use of the Keyboard class Echojava Author LewisLoftus Demonstrates the use of the readString method of the Keyboard class import cslKeyboard public class Echo
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'