LAB 1  (Comp 170)

Getting Started

1.  If you do not already have an account on the departmental network, then Mr. Miao Ye, our network technician, has created a logon id and password for you as follows:   logon id:  first initial + first 6 letters of your last name.  (So Alanis Morissette would be amoriss, and Fiona Apple would be fapple, since apple has only 5 characters.  However, Jack Smith may be jsmith99, since perhaps many J. Smith's attend Loyola.  If your name requires a numerical suffix, then Miao has posted this information on the lab bulletin board.)  Your initial password is nabcdef where "abcdef" are the last six characters in your PID, which appears on your schedule.  (Thus if your PID were P000456789, then your initial password is n456789.)  When you first logon, you will be asked to change your password.  Choose a password which you will easily remember. (The password is case-sensitive, so, for example, "Lassie" is different from "laSSie")   If your account does not exist today, you may logon as "Guest", with empty password.

2.  Logon to Windows NT and briefly navigate Windows files and menus.  The drives (E:, F:, and H:) on the machine named "Turing" should be automatically mapped, so you need not worry about this.  Your directory will reside in Turing (H:)  /home/students/.   Create a subdirectory (folder) called myJavaProjects.   Ask your TA (Kevin Sindelar, Yevgeniya Shteynberg) for help if you need it!

3. Launch Symantec Visual Café 3.0:   From the Start menu select Programs, then Programming tools, and then VCafe3.0.

4.  Start a new project:  The first time that you start VCafe, a default project is already started.  We would like to create our own New Project.  So, close the default new project (by clicking on the X in the blue project pane title bar).  There are several steps necessary to create a new project.  Each is important.

5.  Editing:   In your HelloWorld.java file, type the following program:

          class HelloWorld{
                //This is my very first Java program!
                //Author:  Jacob Dylan
                //Date:  May 24, 1999
               public static void main (String[] args){
                    System.out.println("Bonjour");     // Here we print Bonjour.
                    System.out.println("Press enter to terminate program");
                    String junk = SavitchIn.readLine();
                }
                         }

6.  Saving: 7.  Adding SavitchIn.java to the project:  In this program (and most future programs in this course) we use a pre-written class called SavitchIn which is saved in a file called SavitchIn.java.  This file is on your CD (accompanying your text) and is also stored on the E drive at:  E:\java\classes\savitch\ch01\SavitchIn.java.   Please open this file and add it to your project.  If you forget to add this file to your project then you will see an error message at the time that your program in compiled indicating that SavitchIn cannot be found.

8.  Compiling:

8.  Running:                             public static void main (String[] args){
                    System.out.println("Bonjour");
                }

        One fix is to change it as follows:

            public static void main (String[] args){
                    System.out.println("Bonjour");
                    System.out.println("Press enter to terminate program");
                    String junk = SavitchIn.readLine();
            }

9.  Opening an old project:  10.  Opening an existing source file in an open project: 11.  Consult the Help menu inside Visual Café for much broader and more detailed information.
 

EXERCISES:

(A)   Create a project, which prints a message such as "I think that I am really going to love Comp 170".
What is an appropriate name for this project?  Compile and run it.

(B)  Create a project, VirusWarning, which prints the following message:

     ----------------------------------
    |                                                  |
    |         W A R N I N G                |
    |    Possible virus detected!          |
    |    Reboot and run virus              |
    |        remover software.              |
    |                                                  |
    ----------------------------------

(C)    Re-examine your helloWorld project.  What happens if you:

(D)   Run Program 1 of chapter 1:  First create a new project (in a new folder); then add FirstProgram.java (found at E:\java\classes\savitch\ch01\FirstProgram.java and SavitchIn.java to your project.

(E)   Create a new project, HelloWorld2 (saved in a new folder, helloWorld2). Open the HelloWorld.java file which you worked on earlier, and save it under the new name HelloWorld2.java in the folder helloWorld2.  Modify this file so that it also announces today's weather in Chicago.  Change the class name to HelloWorld2, and add this file to your new project, HelloWorld2.  Run this project.  (What happens if you forget to change the class name?)

(F)  Try saving your file HelloWorld.java file to a floppy.  Then make sure that this .java file is actually on your floppy by reading the directory of .java files on the A: drive.
 

Course Home Page          Department Home Page        Loyola Home Page