CISC2000: Get Started Lab

In this lab, we will focus on familiarizing ourselves with the programming environment.

1. Log on to the storm.cis.fordham.edu server:

Open a terminal program, and type the following command in order to log on to storm.cis.fordham.edu:

ssh -l yourAccount storm.cis.fordham.edu
Note that the -l yourAccount is the dash followed by letter l, and then your storm account (which your advisor hand out to you). This is an option to the command ssh (a Unix command used to securely log in to a remote server. You will be prompted to enter your password, enter the password, and type return. If you have entered your account and password correctly, you will see a prompt message like the following, indicating that you have logged onto the storm server:
[zhang@storm ~]$
Now you can start to type commands into the terminal to get different things done.

How to change your password Type command passwd to change your password. You will be asked to enter your current password, and then enter your new password twice... (Note that the password you type in is not displayed on the terminal for security reason).

[zhang@storm ~]$ passwd
[zhang@storm ~]$ passwd
Changing password for user zhang.
Changing password for zhang.
(current) UNIX password:
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

When you are working from your own computer, you can follow the instruction given at here. http://storm.cis.fordham.edu/~zhang/cs2000/access.html.

2. Review Unix commands

Storm is a Unix system (a type of operating system) which is considerably different from Windows. In order to be more productive in this class, you need to learn some basics about how to get things done in Unix system. Below is a list of useful commands to remember. Note, you can take the following two tutorials, if you haven't done so before:

3. Configure your environment

Now that you have learnt some basic Unix commands, type in the following commands which will set up your account.

4. Using emacs to type in a small program

a. Learn/Review Emacs

Please read the emacs tutorial, pay special attentions to: emacs keystroke conventions, most importantly, C- that you will see in the emacs reference card means pressing Control and chr key at the same time.

Here is a reference card for emacs, and make a note of how to:

b. Read/Fix/Compile/Run a simple program

First go to your home directory, and list files or directories in your home directory.

Create a subdirectory named cs2.

Now, go to CS2 directory, and then create a directory named lab1 under there, and go to this newly created directory. Copy and Paste the file printnumber.cpp into your emacs, and save the file.

This program has a few syntax errors and at least one logic errors. Try to fix them!

Basic compilation command To compile a program named printnumber.cpp, you type in the following command:

g++ printnumber.cpp 
If there is no compile time error, an executable file (by default, it's named a.out) will be created. Alternatively, you can specify the name for the executable file:
g++ -o print.out printnumber.cpp 

6. Submit your program

The following submission method only works from storm server. Write me (xzhang@fordham.edu) if you encounter any problem, including in your email the error message you received. To submit a file named “printnumber.cpp” as part of LAB1 assignment using command:
	submit2000 LAB1 printnumber.cpp
You can then run the command
	verify2000 LAB1 printnumber.cpp
To retrieve the file and verify that if the file has been submitted successfully. It should display the file you submitted back to you.

You have finished lab1.