CS 3733 Operating Systems, Fall 2003 Assignment 0


Due Thursday, September 4, 2003

Assignment 0 has 6 parts.


Part 0:
Access the web site: /classes/cs3733f2003 and find out about assignment 1.

Part 1:
Make sure that you have had your picture taken. If it was not done after the first or second class, come to my office.

Part 2
If you have not already done so, create a web page for yourself.
The address of your web page should be http://www.cs.utsa.edu/~username. Create a course web page with web address http://www.cs.utsa.edu/~username/cs3733/index.html. This should be globally accessible. Your course web page should be very simple without much graphics so that it will load quickly over a phone line.

The permissions of the public_html and cs3733 directories should be drwxr-xr-x and the permissions of the index.html file should be -rw-r--r--.

If you are not familiar with creating HTML files, you may want to use the template available in here. Put the file index.html in your ~username/public_html/cs3733 directory. Edit this file and insert your name in two places.

Part 3:
Make sure you can send and receive mail using your CS account in the Sun lab. You may have the mail sent to your CS account forwarded to another address, but be sure that the address is valid. If you send me email from another account, please make sure you identify yourself as a student in CS 3733. I will be sending mail to the class on a regular basis from the CS3733 account. Please do not respond to this email or send email to this account. The class web site will contain copies of this mail. If you are not receiving this mail, you must notify me.
Do not include any attachements in email to me, unless you are specifically asked to do so. Make sure you know how to include a small ASCII file in an email message without using an attachment.

Part 4:
Write a function with the following prototype:
int compresstokens(char *s);
s is an array of characters terminated by a newline character.
You may not use s to access any characters outside of the array.
When the function returns, all multiple blanks will be removed and the new (possibly shorter) array will be terminated by a newline character. All blanks at the beginning of the array and the end of the array (those before the newline) will be removed also. The function returns the number of tokens found. In this context, a token consists of consecutive characters not containing a blank or newline. A token either starts the array or has a blank before it. The character after a token will always be a blank or newline character.

The compresstokens function always returns an integer that is greater than or equal to 0. It will return 0 if the only characters in the array before the newline are blanks. The only characters that are special as far as this function is concerned are the blank and newline. Any other character (even if not part of the ASCII character set) is considered part of a token.

The compresstokens function should not perform any I/O or have any other side effects. You may not use dynamic memory allocation or make any assumptions about the size of the array. Note that the array is not a string, the string terminator is treated as part of a token. The end of the array is determined by the position of the newline character.

Use the programming sytle described here.

Debug your function as well as you can. You will be graded primarily on the correctness of your function. You should try to make the code as simple to understand as possible. In Part 5 you will be sending me an email copy of your source code. Keep your source lines shorter than 70 characters so that the mail handlers do not corrupt them.

Part 5:
When you have completed the other parts of the assignment and have received at least one class email, send me email at srobbins@cs.utsa.edu informing me that you have completed all parts of Assignment 0. The subject line should be
CS 3733 Assignment 0
This email must be sent directly from your CS Sun account.
The body of your mail message should contain a statement indicating that you have completed the prerequisites for the course and indicate how you satisfied each prerequisite. For example you can state that you took CS 2413 at UTSA last semester and took CS 2734 and CS 3233 the semester before.
Alternatively, you can attach a copy of an email message from me to you in which I state that you may take the course without having formally completed the prerequisites. This course is oversubscribed and those without the prerequisites will need to wait until another semester to take this course.

Also include a statement about your C programming ability. The ability to program in C and to be able to manipulate strings and pointers is a requirement for this course.

At the end of your email, insert the code for your compresstokens function. Remember, this should not be an attachment.

If you are not prompted for a subject line when you send mail, insert an alias in your .cshrc as follows:
alias mail mailx
source your .cshrc and try again.

Grading
This assignment is worth 20 points. Most of the other assignments will be graded on a basis of 30 or 40 points. The compresstokens function is with 10 points of this grade. If it does not work correctly, you will lose at least 5 points. To work correctly, it must work correctly for any possible array terminated by a newline character. To receive credit for this assignment, you must send the email by midnight on September 4.