System.out
with
both print
and println
, etc. You may use my
FunWithStrings
application as a starting point.
TrivialApplication.java
, which defines a class named
TrivialApplication
. "TrivialApplication"
isn't a very good name for a program, especially as the semester
goes on and they get less and less trivial, so you'll probably want
to rename your program to something more meaningful. Once you've
chosen a more sensible name, you'll need to tell CodeWarrior about
it by changing the name in three places:
public class Trivial Application {Replace the word "
TrivialApplication
"
in this line with your more sensible name, e.g.
"FunWithStrings
"
TrivialApplication.java
). Type in your new and
more sensible name, followed by ".java
",
e.g. "FunWithStrings.java
".
Be careful to spell the name exactly the same way, without
adding spaces or changing upper- and lower-case. CodeWarrior
doesn't absolutely require that the filename be the same as the
classname (plus ".java
"),
but some Java compilers do, and it'll make your life easier.
TrivialApplication
". Change the main
class to the name of the class you used in step 1, e.g.
"FunWithStrings
". Do not add the
".java
" suffix, and be sure to spell it
exactly the same way as you did in step 1.
Yes, this is a royal pain. Believe it or not, all this stuff is actually useful to professional programmers using CodeWarrior; it's just unfortunate that you have to deal with it too.
Next, modify it to read a line from the keyboard and write several variants of the line (upper and lower case, concatenated with various other strings, the middle character, etc.) to a disk file.
Add a suitable prompt and flush()
call to your program, so
the keyboard input part is friendlier.
Modify your program so it reads the name of a file from the keyboard, then reads from that file and does various strange things to the contents, writing the results to another file and to the screen.
GreetingMaker.java
and WebHead.java
).
I don't need project files or any of that stuff unless you've chosen to
write your program in more than one source file
(which shouldn't be necessary at this point in the semester).