|ITEC 120 LAB 1|
Lab must be completed and reviewed by Peer Instructor on Wed, Aug 25 during lab class and no later than the first 10 minutes of lab class on Fri, Aug 27.
In this lab you'll copy two Java programs from this page to your folder. You'll compile and run the first one as is. You'll have to correct errors in the second one before it will compile and run. Once you've run the second program, you'll make changes to it and save it as a new source program, compile and run it.
Task 0 - Start machines in the Unix lab in Windows mode, and log on.
The machines in the Unix lab (DAVIS Hall - 225) may be running the Linux Operating System (Unix-like). To run in Windows mode the machines have to be rebooted. To reboot the machine, just hit Ctrl Alt Del. You will then be able to choose which operating system you would like. Please do not reboot the machines by turning the power off and back on.
Log on to a machine in the lab by entering your RU userid and password at the provided login window. (The same username and password you use to check your Radford e-mail.) If you have problems with your userid or password, let us know.
If your RU password is still your six digit student ID you need to change this. You can change your password by logging into the RU portal at https://www.portal.radford.edu/ and clicking on the "change your password" link on the left side of the screen.
Task 1 - Create your ITEC120 directory on your H: drive, and copy two files there.
Double click on My Computer to see if your have a drive mapped to H: (your home direactory).
Create a folder on your network drive named "ITEC120" (this is where you should store all your work for this class)
example1.java , example2.java
Copy these two files to your ITEC120 directory on your network drive. Right-click on the two links above, choose Save link as.., and save to your ITEC120 folder on your virtual drive (H:).
Task 2 - Compile and run your first Java program.
-- Open firstexample.java
in the PFE by double clicking on it.
-- Look at the code, notice how the comments are indicated. Look at the class and method definitions.
-- To compile the program, once the file has been opened in PFE, select Execute, then Compile
-- This should give you back a window without error messages, if it compiled correctly - which it should.
-- You must close this window before you can continue working with original source file, firstexample.java.
-- Now select the Execute, then Run
-- You should see the output from the program, again in its own DOS window
-- Make sure you look back at a listing of the files in your ITEC120 directory (on your H: drive), what file was created?
-- Close this window and the firstexample.java file that is open in PFE
Task 3 - Compile, debug and run the second Java program.
-- In PFE, open example2.java
-- Follow the same procedure to compile it.
-- There is an error in this source file. What message does the compiler output?
-- Look at the source code carefully (example2.java) -- what's wrong with it?
-- Correct the error using PFE, save it, recompile it, and run it.
Task 4 - Modify the second program and save as a new file, then recompile and run.
-- Change the second program,
give it a new class name.
-- Change print to println statements
-- Add 3 more println statements to output more text - output a blank line, your name, and a row of dashes ----
-- Save it to a file that has exactly the same name as the new class name you chose, remember to include the .java extension.
-- Compile and Run the program.
Once you've completed the
lab, you should show the Peer Instructor that you have completed:
-- Run the example2 program,
-- Run the new program, with changes you implemented.
-- Show both source files to the Peer Instructor.