In this lab, we will focus on familiarizing ourselves with the programming environment.
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.eduNote 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.
[zhang@storm ~]$ chsh Changing shell for zhang. Password: New shell [/bin/bash]: /bin/bash Shell not changed.
~zhang/bin/configcs2Note that ~zhang refers to the home directory of user zhang. Here you are running a command that I wrote, which configure your account.
The above command creates a directory called CS2GradedLabs in your home directory. Graded programming assignments will be returned into this directory.
Please read the emacs tutorial, pay special attentions to:
emacs keystroke conventions, most importantly, C-
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:
You have finished lab1.
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.