/* Example code from Sept 2 */ package sept2test; import java.util.Scanner; /** * * @author jcmtiernan */ public class Sept2Test { /** * @param args the command line arguments */ public static void main(String[] args) { // Test code Scanner input = new Scanner(System.in); int myValue; int secondValue; double floatingPointValue, secondFLValue; byte smallValue; boolean twoValue; int strLength; int strEO; String str1 = "This is CSE 1310 class on Thursday 10 Sept 2015"; String str2 = new String(); String str3; System.out.println(str1); System.out.println("**"+str2+"**"); System.out.print("Please enter a line of input with at least two words: "); str3 = input.nextLine(); //str3 = str3.substring(5, 5); System.out.println(str3); strLength = str3.length(); System.out.println("THe string length is "+strLength); strEO = strLength % 2; // save 0 or 1 for even or odd if (strEO == 0) { System.out.println("THe length of the string is even"); } else if (strLength > 6) { System.out.println("THe length of the string is odd and longer than 6"); } else { System.out.println("THe length of the string is odd and shorter than 6"); } /* System.out.print("Please enter an integer: "); myValue = input.nextInt(); System.out.print("Now enter a" +"floating point number: "); floatingPointValue = input.nextDouble(); System.out.print("Please enter a byte value: "); smallValue = input.nextByte(); System.out.println("Now we compare "+myValue+" and "+floatingPointValue+" to get a boolean value: "); twoValue = (myValue != floatingPointValue); secondValue = 9; secondFLValue = secondValue/floatingPointValue; */ //System.out.println("Result of 9 / FLValue is: "+secondFLValue); //System.out.println("Y'all are awesome!"); //System.out.print("You are a perfect "); //System.out.println((6+4)/myValue); //System.out.println("The input values were "+myValue+" and "+floatingPointValue); //System.out.println("The byte and boolean are "+smallValue+" and "+twoValue); } }