| || 18 ||Jan
|| 18-19 ||Jan
|| 18-19 ||Jan
|| 21 ||Jan
By the end of this lab, you should...
know how to navigate the CS101 web pages.
know how to edit, compile, and execute Java programs.
have your own home page on CEC.
know how to find the instructor's office and the CS101 mailbox.
Part I: Electronic Orientation
The CS101 web pages will be an important reference in CS101, so it's good
to know what's there. They contain everything from lecture highlights to
frequently-asked-questions on assignments. The following Web Page
Treasure Hunt is designed to make sure you know your way around the CS101
web pages, and call your attention to certain important items along the
First, read Navigating
the CS101 Web Pages. Then, use the web to answer the following CS101
trivia questions. Write down the answers (handwritten on notebook paper
When and where are the CS101 organized help sessions? (Hint: Look at the
When and where are the CS101 instructor's office hours? (Hint: Look at
the CS101 home page.)
What overall percentage is required to earn an A+ in CS101?
How much time should you expect to spend on CS101? (Hint: Look at the Frequently
Asked Questions page.)
What are the email addresses for the head teaching assistants for CS101?
Name one reason why is class attendance so important in CS101. (Hint: Find
the Attendance Policy on the home page.)
According to the CS101 Collaboration Policy, would you be cheating if you
helped someone find an error in their program? (Hint: Read the examples
on the Collaboration Policy page.)
What is the only acceptable way to turn in a lab late?
(Hint: Read the late policy).
What is the definition of abstraction?
What is the due date for Lab 4?
On the lecture highlights page, what is the second subtopic under the first
main heading in the course outline?
Part II: Getting Started with Java
You now know the steps necessary to edit, compile, and run Java programs.
Please ask if you have questions about any of this. A word to the wise:
Remember to save your files often, and get into the habit of saving your
files onto a floppy disk after each lab session, just in case there is
a problem with the file server.
Floppies may be purchased at the CEC
Log onto a PC in Sever 201 or 202. (If you own a computer and want
to set it up
for CS101, read how
to set up your computer for CS101. In CEC, you'll be using
your H: drive, but at home most likely it will be your C: drive.)
On your H: drive,
create a folder called cs101, in which to keep your lab assignments.
Click on the "Download Project" link in the online version of this assignment.
Ask a TA if you need help.
If WinZip doesn't come up automatically the link, you can save the
project.zip file in your cs101 folder, and then
launch WinZip using the "Start" menu using the "Utilities" submenu.)
After the project.zip file is opened within WinZip,
click on the
extract button in WinZip, select
your CS101 folder,
and extract the files,
that the "use folder names" box is checked.
Click on the Start button and look under "Programming" to start up
Emacs for Java.
Emacs is a text editor that lets you create text files,
including files that contain the text of Java programs.
With emacs, we have installed the Emacs JDE, which stands for
Java Development Environment, which provides facilities
for compiling and running your Java programs.
(If emacs doesn't open, see the frequently
asked questions page or ask a TA.
Pull down the Files menu and select "Open File..."
At the bottom of the emacs window, you will be asked to provide the name
of the file you want emacs to find.
Type cs101/Lab0/Startup.java and then press the "enter" key to
open that provided file.
At the top of the file, you will see
a comment block that identifies the file and
explains its contents. Fill in your name, lab section, email address and
today's date in the appropriate places. Every file you create should have
a header comment similar to this one.
Find the line that says "public void run()". This is
where the Startup object begins running.
Type your name in the appropriate place in the message (replacing the XXX).
Now save the file by selecting "Save Buffer" from the Files menu.
Ask a TA if you need help editing or saving files.
Now open the provided file cs101/Lab0/Lab0.java.
You'll see a procedure called main, which serves as the
starting point for the program. You don't need to modify this file.
Before you can execute a program, it must first be compiled (translated)
into byte code that can be executed by the Java interpreter. A program
that performs this translation
is called a compiler. Compile your program
by selecting "compile" from the JDE menu.
(If you have edited files but not yet saved the changes,
emacs will ask if you want to save them before compiling.)
During compilation, an output buffer will appear
in which the Java compiler will print messages. Whenever
you have compilation errors, they will appear in this output buffer.
If there aren't errors, the compiler will create some class files
that are the result of the compilation.
The class files are not human-readable, but instead they are read by the
Java interpreter in order to run your program.
When compilation is successfully completed, run the program you just edited
by choosing "run app" from the JDE menu. An output buffer
will display the output from your program as it runs. Get help from a TA
if the program doesn't execute.
Your program should have created a file called
transcript.txt containing the output printed by the Terminal.
If you open the file cs101/Lab0/transcript.txt,
you should see the output from
your program in the file (similar to what you saw in the output buffer).
Print this file using the print command
in the Tools menu of the editor.
Be sure to select "Print Buffer" (not "Print Region", which is used for
selecting a portion of the text to print).
Pick up your printed output from the printer.
Ask if you need help.
Part III: Home Page
If you don't already have a home page on CEC, read How
To Create a CEC Home Page and follows the instructions. (Please do
this even if you already have a home page in Arts and Sciences or elsewhere.)
Part IV: Complete Your CS101 Registration
Read the CS101
Policy on Collaboration. In registering for this course, you agree
to abide by that policy and the academic integrity policy of the university.
If you do not understand the policy, please ask. If you do not agree with
the policy and cannot live according to it, then you should not take this
If you haven't yet officially registered for CS101, be sure to do so as
soon as possible.
Part V: Physical Orientation
On the back of the piece of paper you used in Part I, write a clear, concise
procedure in English that describes, step by step, the process of
walking from Sever 201 (the PC lab) to Bryan 525 (without walking outside).
Hint: On exiting Sever 201, turn right. The hallway will dead-end into
the 4th floor of Lopata. This map
of the School of Engineering and Applied Science may help you plan
your route. Walk the route and include landmarks along the way in your
What To Turn In:
For every CS101 lab you turn in, you should fill in a cover
sheet and staple it on the front of your lab. You can either print
out the cover sheet or pick one up from the stack on top of the CS101 mailbox. (If you print the cover sheet, use "print
preview" to check that it fits on one page. If it spills onto a
second page, decrease the font
size preference in your browser so that it prints as a single page.)
Attach the following items:
Part I: Your handwritten answers to the questions (or typed if you
Part II: Your printed transcript file.
Part III: A printed copy of your web page, including your name and
some information about you.
If your web page takes more than one sheet of paper,
just print the first page with your name and on it.
Part IV: Nothing needs to be turned in, but be sure you are registered
for the course.
Part V: Your handwritten (or typed) directions to the instructor's
Everything should be stapled together and submitted in class on the due
Last modified 08:24:30 CST 16 January 2000
by Ron K. Cytron