Practice Lab Exam
CPE 101
Spring 2003
Turner sections 02 and 03


A critical, basic skill you are required to learn is to create 
source code files, compile them into .class files, and run them
from the command line (not using an IDE).  This practice exam will
give you an initial test of that skill.  You will be required to
1. create a source code file using an editor;
2. compile the file(s) using the SDK, on the command line;
3. run the java interpreter from the command line to run the
program.

You may not use any aids in this process, not an IDE (like JCreator)
and you may not use your book or notes.  You must be able to demonstrate
that you know how to do this on your own.

The program that you must write and demonstrate will be an 
application program (not an applet).  

The first, bare minimum, that your program must do is to demonstrate
that you can write to the console.  Write a "Hello World!" program
(or other phrase of your choice, no profanity please.)  Call the file
"HelloWorldApp.java"

The second thing that you should demonstrate is that you can write 
another class, called "SecondClass.java", that holds a single data field of 
type int, that you will instantiate and use in your "HelloWorldApp" class.  
Write a mutator method to set this data field.  Write an
accessor method to get this data field.  In your main method, 
instantiate an object from SecondClass and set the value of your
data field to 10.  Then get it and print it out from your main method.

These two programming tasks will demonstrate a good basic knowledge 
of write a simple program in Java.  I will give you up to 20 minutes to
do this.

You must work alone.  You may ask questions ONLY of your Professor and 
Lab Assistant.  Once you have your program working, you must print out 
your program listings with comments or header file showing your name, 
date and the title "Practice Lab Exam for CPE 101" and hand them into 
your Professor or Lab Assistant to check you off when you demonstrate
your program at the minimum level or better.