/* CIS 790 kb21.java PROF. AUCIELLO type conversions. converting strings to chars to integers. do { } while (condition) */ class kb21 { public static void main(String args[]) { byte buff2[] = new byte[64]; byte buffer[] = new byte[2056]; char c; int cdec; String charin; try { do { // NOTE. THIS METHOD READS ENTIRE STRING INC. LF & CR. // 1st try: System.out.print ("Enter Single Character (/ to exit) "); System.in.read(buff2, 0, 64); String str5 = new String(buff2,0); // System.out.println("Untrimmed Length of " + str5 + " = " + str5.length()); String str6 = str5.trim(); // System.out.println("Trimmed Length of " + str6 + " = " + str6.length()); c = str6.charAt(0); cdec = (int) c; System.out.println(c + " = " + cdec); //System.out.print("Type a Single Character "); //c = (char)System.in.read(); //cdec = (int) c; //System.out.println(c + " = " cded); } while (cdec != 47); } catch (Exception e) { String err = e.toString(); System.out.println(err); } // end try-catch. } // end main procedure. } // end class