Things to note for ITEC120 hw02 hw02 (problem#1: song info). - Input for this hw is via `javax.swing.JOptionPane`'s method `String showInputDialog(String)`. On the other hand, output for this hw is via `System.out.println`. - The program will be in "one big main" which reads input, computes, and then prints out messages. No fields, just local variables. (We'll introduce individual methods later, with the principle of one-task-per-method. So in later homeworks, there should be at least three methods [one to read in input, one to compute answers, and one to print out answer].) - Part of the hw is (intentionally) needing to look up in the API what 'indexOf' returns exactly, plus what method to call to remove trailing/leading whitespace, is part of the assignment. - There are trade-offs between using a variable for each bit of info, vs doing several bits of computation on one line. Either way is fine. For example, consider finding last character in a string: int lastIndx; lastIndx = str.length() - 1; char lastLetter; lastLetter = str.charAt(lastIndx); System.out.println( "The last letter is " + lastLetter ); as compared to int lastIndx; lastIndx = str.length() - 1; System.out.println( "The last letter is " + str.charAt(lastIndx) ); as compared to System.out.println( "The last letter is " + str.charAt(str.length()-1) ); All three approaches are fine. - Using 'import' is fine, although barland's lecture tends to just always use the class's full name, and not bothering with 'import'. (Do not use the '*' form of import, though.) - Problems 2-5 will be talked about in lecture this upcoming week (Feb.02-04).