|
Lab 1 |
| . |
LAB #1 Keyboard practice, copy-paste, and modify a program
If you do not have a JJ account, email us to setup your account
-----------------------------
Lab #1.1: Copy and paste the following program in JJ. CheckIt and RunIt.
-----------------------------
String attempt;
String challengeString;
challengeString =
"The quick brown fox jumps over a lazy dog";
JJS.outputlnString("Test your typing, enter the following sentence: ");
JJS.outputlnString("");
JJS.outputlnString(challengeString);
JJS.outputlnString("");
attempt = JJS.inputString();
System.out.print("Your time in milliseconds: ");
System.out.println(JJS.millisSinceStart());
if (attempt.equals(challengeString)) {
JJS.outputlnString("Congratulations, you got it!");
} else {
JJS.outputlnString(attempt);
JJS.outputlnString("Sorry, your typing is not exactly correct");
JJS.outputlnString("Press [Start] to try again.");
}
-----------------------------
Lab #1.2
-----------------------------
Modify the above program so that it
asks for the user to enter some sort
of sentence other than "The quick brown fox..."
sentence.
-----------------------------
Challenge Lab #1.3
-----------------------------
(You Cannot Do The Challenge LabThe Challenge Lab is not something that you could do given only the information from the presentation. It is meant for the advanced viewer, the people taking the workshop who come in with prior Java experience and typically are working ahead of the others. It is recommended to skip the Challenge Labs and return to them after completing the following modules.)
Modify the above program so that it
asks for the user's name.
Store their name, then display their
name in some sort of "Hello"
message such as
Hello David, now it is time to test your typing.
After displaying this message, the program
should continue as in Lab #1.2 above.
HINT: Use a combination of JJS.output and
JJS.outputln commands, or use the
String-concatenation-operator ('+').
-----------------------------
Extra Lab! |