Students who complete this lab will demonstrate that they can:
One advantage of moving to the full Java platform is the availability of more powerful development environments. You will use one of the following for the remainder of your labs and homeworks:
If you haven't already done so, use your Java IDE to do the following:
edu.calvin.yourLoginID.lab06. (Be sure to replace
yourLoginIDwith your unique value).
Use this package for all the exercises in this lab. Take time now to make sure that you can find the package/directory you just created; you will submit this package/directory in same way that you submitted your work for Processing.
You can find a full Java API documentation here: http://docs.oracle.com/javase/7/docs/api/.
All the Processing-based applications in this course have been graphically oriented, but Java also supports command-line or console-based applications that read input that the user types on the keyboard and print their output on the textual console. We will not build many console-based applications, but it’s useful to see how they work.
You build a Java program by creating a new Java class with a
method; you can then run this class as a Java application. To create
the class in eclipse, right-click on the package where you want to
place the class (in this case,
) and choose "New"-"Class".
Use your Java IDE to build a simple, console-based Java application
that reads in a person’s name and prints out a friendly
welcome. Call your program class
. It should implement this, exceedingly simple, algorithm:
Here is an example run:
Please enter your name: Rembrandt Welcome, Rembrandt!
Here, the user typed
following the prompt. Save this program using your Java IDE.
You’ll find the the file under Eclipse’s
directories under a series of directories in directories that match
the package name you gave to the program, as in:
Submit the directory
and the code file
contained within. We will grade this exercise according to the