CSC 4630 - 001

Software Development and Systems

Lab #4

Due Date: April 30, 2013


Coverage (of exam, too!):


As usual, it's critical that no program crashes. You'll get more credit for a program that does nothing or gives incorrect results than for one that has a syntax or logical error that causes the grading script to crash! This includes making sure that your C programs compile and run correctly on the department Solaris systems. Don't submit the executables for them; we'll compile them. And, speaking of C, figure that the exam will include problems that are strongly related to the ones on this lab.

And now, speaking of the exam, the Perl part of it will be related to the Perl programs we'll have covered in class.


Perl

Choose three of these seven programs from Lab 2: backup, oneword, nodigits, moredips, Asiapop.awk, avgpop.awk and chem.awk, and write Perl versions of them.


C

pointersstuff) Assume the definitions

struct {
	char name[50];	// null-terminated
	char ssn[10];	// ditto
	int class	// 1 for freshman/woman; 2 for sophomore; etc.
	float balance_on_bill;
} student, *sptr, classlist[200];
Note this is not a program, but a narrative:
Write expressions for each of the following. The last two parts are statements, of course, that have already been started out for you.

lastarglength.c) This is (obviously) a C program. It returns the length of the last command-line argument. We'll call its executable lastarglength. Hence

$ lastarglength of mine
The length of the last command-line argument is 4.
$ lastarglength
The length of the last command-line argument is 13.


Back to CSC 4630 Homepage