CPSC 120 LAB 1 | Back to Lab index page |
Lab must be completed and reviewed by Peer Instructor Seth Peery no later than Wed, Aug 29 during lab class.
Logging On
You must log in using your own account (userid and password)
Note: If you are an upperclassperson who is still using your Radford ID number
as a password, you will need to change that before you begin. (You may change
that at the Radford webmail site.)
Adding the Ada compiler so you can
compile Ada programs.
Once logged in -- type addada at the command prompt. If you've
had CPSC 120 before and has executed this command before, the script will print
a message stating that this has been done and the account is set to compile
Ada programs. Otherwise, it will add the correct commands to your .cshrc files
so youÕll be able to compile Ada programs.
YouÕll need to log off and back on again to complete the process.
Once you've added ada, you need to:
rsh rucs2 (remote shell to rucs2) hit enter to accept the terminal type
TERM = (xterm)
At the command line, youÕll type vimlearn
Perform the VIM tutorial.
Using the VIM editor, create a file
containing the HELLO Program given below.
Name the file hello.adb (vim hello.adb)
WITH Ada.Text_IO;
Procedure Hello IS
----------------------------------------------
-- A very simple program; it displays a greeting
----------------------------------------------
BEGIN -- Hello
Ada.Text_IO.Put(Item => "Hello there. ");
Ada.Text_IO.Put(Item => "We hope you enjoy studying Ada!");
Ada.Text_IO.New_Line;
End Hello;
-----------------------------------------------
Compile the program (gnatmake
hello.adb)
Execute the program again and redirect the output to a file named hello.out
(hello > hello.out)
List the files in the directory now. Run the program again and append the output
to the file hello.out.
(hello >> hello.out)
Look at the file hello.out
(more hello.out)
a few UNIX Commands
ls | lists the contents (all the files) of the current working directory (CWD) |
ls -l | lists the contents of the CWD in the long format |
mkdir | creates a new directory |
cd | directory makes directory the CWD |
rm | filename removes (deletes filename from the CWD) |
mv fn1 fn2 | change the name of filename1 to filename2 |
netscape | opens netscape for web browsing |
Look at the contents of the CWD
Make a new directory named cpsc120
Make cpsc 120 the CWD
Move back to the original directory, where you started