# 03 Char
# String Methods
charAt()length()
# Goal:
Use charAt and length methods to access information in a String variable.
# Steps:
- Create a String variable and initialize it with some characters (at least 3).
- Use the charAt method to print the 3rd character in the String (remember, computers start counting at zero).
- Use the length method to print how many characters are in the String.
- Use a for loop to examine each character in the String, and when you find one that matches the character you are looking for, print its index.
# Pi Aloud
# Goal:
Use charAt and length methods to access the digits of pi in a String variable.
# Steps:
- Place the first 20 digits of pi into a String variable.
- Print out the first 3 digits of pi. Remember the first digit will be pi.charAt(0).
- Use a for loop to print each digit of pi on a new line.
- If your computer can play sounds, use the speak method to say each digit of pi using a loop.
- [CHALLENGE]
After printing the first 3 digits of pi, ask the user for the next digit using the getInputFromUser() method
Compare the users' char to the next digit of pi
If they are correct, print out "correct". If they are not, print "incorrect"