 The purpose of this program is to take a phone word and translate it into a phone number. Let's do some examples and see how it works. Let's start with the word, airline. We're going to process letters and digits as we find them and ignore everything else. The first character in the string is the letter A. Once a letter, we look it up and that corresponds to the numeral 2, which goes into our result. The next character is a letter I, which corresponds to the numeral 4. The next character is a letter R, which corresponds to 7. The next character is a letter L, which corresponds to 5. The next character is a letter I, which corresponds to 4. The next character is letter N, which corresponds to 6. And the next character is the letter E, which corresponds to 3. We're out of characters and we have 7 digits and that's a valid phone number. Let's try this one. Good for you too. The first character is a letter G, which corresponds to 4. The next character, letter O, corresponds to 6. The next character, letter O, corresponds to 6. The next character is a letter D, corresponding to 3. The number is already a numeral and we pass it on unchanged. The next character is a letter U, which corresponds to 8. And the next character is a numeral 2 and it gets added to the result unchanged. And we have another good 7 digit phone number. Now let's try some things that don't fit the pattern. For example, discovery. These are all letters so I'm going to omit the part about this is a letter. D corresponds to 3. I corresponds to 4. S is numeral 7. C is numeral 2. O is numeral 6. V is numeral 8. E is numeral 3. R is numeral 7. Y is numeral 9. That's more than 7 numerals. The solution is drop everything after the 7th numeral. And now we have a valid 7 digit phone number. Let's try this one. Bad-cats. E, the letter, corresponds to 2. A corresponds to 2. D gives us a 3. This is not a letter, it's not a digit, so we don't add anything to the result and continue to the next character C, which is a 2. A, which is a 2. T, which is an 8. And S, which is a 7. And that's a valid 7 digit phone number. What about this example? Go-kart. G is a letter corresponding to 4. O is numeral 6. Dash, not a letter, not a digit, don't do anything. K is the number 5. A is number 2. R is a 7. And T is an 8. That's only 6 digits, which means it's not a valid phone word. We're making the decision of whether it's valid after we've processed the phone word, not before. If we look at it before, we have 1, 2, 3, 4, 5, 6, 7 characters, and we might think, oh good, that's going to be valid. But we don't know that for sure until we look at the final result and find out that it happens to be too short. Let's do one more. OK, comma, space, great, exclamation point. O is 6. K, the letter, gives numeral 5. Comma, not a letter, not a digit, skip it. Space, not a comma, not a digit, skip it. G corresponds to 4. R is numeral 7. E is numeral 3. A is numeral 2. T is numeral 8. Exclamation point, not a letter, not a digit, skip it. And we end up with a valid 7 digit phone number. Here's the pseudocode to accomplish that task. I'm doing this on the computer because I type faster than I write and also my handwriting is pretty difficult to read. We'll input the phone word and we'll set our result string to the empty string. Now we need a for loop that has an index that goes from 0 up to the length of the phone word and we'll have a character, CH, which will be set to the phone word of the current index. If the character is a letter, then we're going to find the corresponding digit and add it to the result. And that's going to be an if-else chain that'll do that. Otherwise, if it's not a letter, we want to see if the character that we're looking at is a digit. If it is, then we'll add it to the result. Everything else is going to be ignored. We don't need an else to say do nothing. But if it makes you feel good to have one, you can say else and then put in a comment saying do nothing for non-digits and non-letters. That way, the person who's reading your code will know why you have an else that doesn't do anything. After we've finished processing all the characters in the phone word string, we now need to look at the result string. If the result length is less than 7, then we're going to print an error message. Otherwise, it's 7 or greater and we can use the substring function to get the first 7 characters and print that result. It's the phone number. And there's our pseudocode. Again, it's half English, half Java, but this is the outline for how we're going to write the program.