Hints for lab 3 about working with strings and characters
- To get a character, read in a string and then use the charAt() function. See the class example for the exact syntax
- It is best in this lab to do keyboard.nextLine() after any keyboard.nextDouble() if one is getting a string after a double. This is important to "eat" the end of line character after the double before getting the string on the next line of input. Example:
number = keyboard.nextDouble();
keyboard.nextLine();
…
str = keyboard.nextLine();