Skip to content

Commit 5058a48

Browse files
committed
new recipe OneFishTwoFish
1 parent 987e487 commit 5058a48

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

src/main/java/org/teachingkidsprogramming/recipes/completed/section06modelviewcontroller/OneFishTwoFish.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public Iterator<String> iterator()
4545
}
4646
})
4747
{
48+
// Display "And then: " and the fish in the console
4849
System.out.println("And then: " + fish);
4950
}
5051
System.out.println("");
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package org.teachingkidsprogramming.section06modelviewcontroller;
2+
3+
//*************This Lesson is In Development*****************************//
4+
@SuppressWarnings("unused")
5+
public class OneFishTwoFish
6+
{
7+
// Create a Scanner to make a string
8+
public static void main(String[] args)
9+
{
10+
makeAString();
11+
}
12+
public static void makeAString()
13+
{
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
18+
}
19+
private static void tellAStory(final String input)
20+
{
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
29+
{
30+
// Display "And then: " and the fish in the console
31+
}
32+
System.out.println("");
33+
}
34+
}

0 commit comments

Comments
 (0)