Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package org.teachingkidsprogramming.recipes;

import org.teachingextensions.simpleparser.Parser;
import org.teachingextensions.utils.Viewer;
import org.teachingextensions.windows.MessageBox;

public class AdLibs
{
public static void main(String[] args)
{
//Ask the user to enter an adverb, save it as currentAdverb --#2
//Ask the user to enter a verb ending in '-ed', save it as currentEdVerb --#4
//Ask the user to enter a body part, save it as currentBodyPart --#6
//Set the value of the currentStory to the word "Today " --#1.2
//Add the words "I woke " + currentAdverb + ". " to the currentStory --#3
//Add the words '"Then I " + currentEdVerb + " " to the currentStory --#5
//Add the words "my " + currentBodyPart + ". " to the current story --#7
//Show the currentStory in a message box as a message --#1.1
Words words = new Words();
words.adverb = MessageBox.askForTextInput("Please enter an adverb ");
words.edVerb = MessageBox.askForTextInput("Enter a verb ending in '-ed'. ");
words.bodyPart = MessageBox.askForTextInput("Please state a body part.");
String story = Parser.parseRtfFile("view.rtf", words);
// MessageBox.showMessage(story);
Viewer.displayRtfFile(story);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.teachingkidsprogramming.recipes;

public class Words
{
public String adverb;
public String edVerb;
public String bodyPart;
}
Binary file not shown.