Editing, Compiling, Running C++ Programs; Turning in results
Goals
The goals of this lab are to check that you can use the UNIX shell, emacs, and the C++ compiler, g++.
This lab also gives you practice in
using the turnin program.
What you should do...
cd~
Note the use of the tilde "~" to signify
"my home directory".
mkdirlab0
cd lab0
pwd
script labscript
/cs/cs2005/labs/lab0/bubble.cxx to your working
directory and verify that the copy is there. You can use the shell commands:
cp/cs/cs2005/labs/lab0/bubble.cxx .
ls
Note the use of the period "." to signify "my working
directory".
bubble.cxx.
As discussed in the pre-lab for Lab 0, you need to add the inner loop to the bubble
sort function of bubble.cxx.
Save the buffer and exit emacs after you make the changes.
emacsbubble.cxx
bubble.cxx using g++. You
can use the shell command:
g++bubble.cxx
a.out.
If you get an error similar to
a.out: command not found
then your PATH variable is set wrong. The easiest solution is to use
the command ./a.out
(which says "run the program a.out in the current working
directory").
exit
/cs/bin/turnin submit cs2005 lab0 bubble.cxx labscript
This command runs a program which submits your files electronically, so that the TAs can retrieve and grade them. lab0 is the name of the project.
The files that you are turning in to lab0 are bubble.cxx
and labscript.
/cs/bin/turnin verify cs2005 lab0