man man
Look up printf and read a bit about it.
lab0).
mkdir classes
mkdir classes/cse332
mkdir classes/cse332/lab0
If you're not familiar with mkdir, quickly look at the
manual page for it with man mkdir. Or, if you prefer,
there are graphical tools to help you do all of this.
lscdmkdirgrepfinddiffwclab0 directory, and write your first C
program. Start up an editor (I'd recommend emacs or
gedit if you don't have a preference), and create a
file called lab0.c with the following contents:
|
Compile this program
gcc -Wall -o lab0 lab0.c
and run it to make sure it works.
lab0
If this doesn't work, then try ./lab0 (we'll talk about
this in class).
ls -lstringsnmldd
find . -name "*.txt" | xargs grep "foobar"
and send a brief explanation to us at cse332@cec.wustl.edu. Make
sure you include your name in the body of this email.
This lab will be graded specially. If you do all three parts above, you will get one point. If you do not, you will get zero points. The grades for this lab will be used as a multiplier for all other grades for the rest of this class. We will multiply your grade for every other lab by your grade for this lab.
Yes, we really mean this.
If you find something particularly interesting while doing this assignment, then feel free to share it with the class on the message board. For example, if you find an excellent editor that will make everyone's life easier, post some details about it.
Among other things, programming computers is about precision. As we progress through the semester, we will give you assignments that are more and more open to interpretation. However, if we tell you to do something a particular way, you should make an effort to do it that way, even if it seems irrelevant. An excellent example of this is the class slogan: We really mean not more than ten words. Slogans, however clever, of more than ten words are wrong answers.
We're also going to assume that you're a grown up and reasonable person. This means that we're sometimes not going to cover all of the interpretations of an assignment question. Try to follow the spirit of the assignment, and if there's any ambiguity, then ask us for clarification. Arguments such as "But, technically, you didn't say that I couldn't comment the code in Klingon" are not likely to receive a warm reception. An excellent example of this is the class slogan: Not more than ten words admits slogans of fewer than 1 word. It also allows the definition of "word" open to interpretation. Zero-word slogans, while pleasing to students of certain Zen schools, aren't really what we're after.
Apart from the pleasing rhetoric of all of this, it does actually have some bearing on programming. Suppose we tell you to read in a line from a file, and that the line will have fewer than ten words on it. Does this include zero as a valid number of words? What are words in this context? If we don't explicitly tell you in the assignment, then you can either ask for clarification, or you can make some (reasonable) assumptions (zero to nine words, words are contiguous sets if characters delimited by the space character), and write them down, so that we know what they are when we come to grade your code.
| Page written by Bill Smart. |