|
4 | 4 | @SuppressWarnings("unused") |
5 | 5 | public class OneFishTwoFish |
6 | 6 | { |
7 | | - // Create a Scanner to make a string |
| 7 | + // Create a Scanner to make a string --#1 |
8 | 8 | public static void main(String[] args) |
9 | 9 | { |
10 | 10 | makeAString(); |
11 | 11 | } |
12 | 12 | public static void makeAString() |
13 | 13 | { |
14 | 14 | final String input = "1 fish 2 fish red fish blue fish,black fish,blue fish,old fish,new fish "; |
15 | | - // Use your scanner with your input |
16 | | - // Display a new line and "We have: " and the input and then a new line |
17 | | - // Now, tell a story with a new Scanner instance |
| 15 | + // Use your scanner with your input --#2 |
| 16 | + // Display a new line and "We have: " and the input and then a new line --#3 |
| 17 | + // Now, tell a story with a new Scanner instance (tellAStory recipe) --#8 |
18 | 18 | } |
| 19 | + //-------recipe for tellAStory------------------------------------ |
19 | 20 | private static void tellAStory(final String input) |
20 | 21 | { |
21 | | - // Use 'fish' as the base text w/your scanner [story] HINT: useDelimeter |
22 | | - // Get the next number to use in your scanner [story] HINT: nextInt |
23 | | - // Get the next value to use in your scanner [story] HINT: next |
24 | | - // Iterate over each fish [string] HINT: Interable |
25 | | - // Create a new string iterator |
26 | | - // Create a new scanner for your input |
27 | | - // Use a comma to separate the strings in your story HINT: useDelimeter |
28 | | - // Return the result |
| 22 | + // Use 'fish' as the base text w/your scanner [story] HINT: useDelimeter --#5 |
| 23 | + // Get the next number to use in your scanner [story] HINT: nextInt --#7 |
| 24 | + // Get the next value to use in your scanner [story] HINT: next --#9 |
| 25 | + // Iterate over each fish [string] HINT: Interable --#10 |
| 26 | + // Create a new string iterator --#11 |
| 27 | + // Create a new scanner for your input --#12 |
| 28 | + // Use a comma to separate the strings in your story HINT: useDelimeter --#13 |
| 29 | + // Return the result --#6 |
29 | 30 | { |
30 | | - // Display "And then: " and the fish in the console |
| 31 | + // Display "And then: " and the fish in the console --#14 |
31 | 32 | } |
32 | 33 | System.out.println(""); |
| 34 | + //------end recipe tellAStory-------------------------------------- |
33 | 35 | } |
34 | 36 | } |
0 commit comments