/** * The testcuinput class below uses cui class, and takes various * variables inputs from the console, happy progamming !!! * * @author (Shirshasin Ghosh) * @version (2.0 on 12.8.2004) */ public class testcuinput { /* In BlueJ write here, public void testinputs() */ public static void main(String args[]) { cui s1 = new cui() ; byte b = 0 ; short s = 0 ; int i = 0 ; long l = 0 ; float f = 0 ; double d = 0 ; char c = ' ' ; boolean bln = true ; String strn = "" ; s1.show("Various data types will be inputed next dialog boxes..\n" ) ; s1.ecc(true) ; b = s1.getByte("Enter Value of a byte.."); s = s1.getShort("Please enter a short number...") ; i = s1.getInt("Please enter an integer..."); l = s1.getLong("Please enter a long integer...") ; if (s1.isprime(l)) s1.show("Do you know "+l+" is also a Prime Number !"); f = s1.getFloat("Please enter a floating point number...") ; d = s1.getDouble("Please enter double precision number...") ; c = s1.getChar("Please enter a single charecter...") ; strn = s1.getString("Please enter a String, or a Word...") ; bln = s1.getBoolean("Please enter a boolean... t or f , y or n...") ; s1.show("You have entered : Byte = "+b+" : Short = "+s+" : Integer = "+i+" : Long = "+l+ "\n Float = "+f+" : Double = "+d+" : Char = "+c+" : String = "+strn+" : Boolean = "+bln); s1.showline(5); System.out.println("It is now 5 lines below"); s1.space(25); System.out.print("25 spaces right\n") ; System.exit(1); } /* End of main() */ } /* End of testguinput class */