Pre-Lab Assignment: Lab #1
Note: This work is to be completed and handed in at the start of lab on Thursday
This document is found at http://cs.roanoke.edu/Fall2005/CPSC120A/lab1/pre1.html
- When first working in Linux students often have trouble distinguishing
between commands (such as cd) that perform operations in the file
system and the files themselves (the names (or symbols) for the
files).
- In a UNIX file system, what symbol represents each of the following
important directories?
the root directory for the system _________
the current directory you are working in ___________
the directory one level up in the tree from the one you are currently in
_________
your home directory _________
- Give the command to do each of the following (the complete
command):
Change into the root directory _____________________
Show the pathname of your current working directory __________________
Change to the directory one level up in the tree from the one you are
currently in ________________________________
Go to your home directory ___________________
- The root directory in a Unix system contains a subdirectory named
bin. What does the bin directory contain?
- Suppose the permissions on a file are -rw-rw----.
- Can someone other than the owner look at this file? Explain.
- Can someone other than the owner make modifications to this file? Explain.
- What command do you use to get a list of the files in your
current directory that also shows the permissions on the files (and other
information such as when the files were created)?
- Suppose you are currently in bozo's home directory of
the file structure chart handed out in class.
- What is the relative pathname of the file Fun.java?
- Suppose you are still in bozo's home and you want
to copy the file Fun.java into bozo's games subdirectory. Suppose you
type in the command
cp Fun.java
You will get an error message. There are two problems with this
command. What are the two problems?
Write the correct command to copy the file.
- Suppose your task is to write a Java program that will
print out the following message (including the row of equal marks):
Computer Science, Yes!!!!
=========================
The following is an outline of the program. Complete it as follows:
- In the documentation at the top, fill in the name of the file the
program would be saved in and your name as the author.
- Add the code for the main method to do the printing.
// *******************************************************************
// File Name: ___________________________________________________
//
// Author: _________________________________________
// *******************************************************************
public class CSYes
{
// -------------------------------------------------
// The following main method prints an exciting
// message about computer science
// -------------------------------------------------
}
- What is Java bytecode?
- What is white space and how does it affect the readability of
a program?