CS0132/7132 Programming in C and Guide to Unix

Spring 1997 TuTh 2:30pm-3:50pm 332 Alumni Hall

Instructor: Prof. S. K. Chang
Office 215 MIB, Office Hours TuTh 12:30pm-2:30pm
Tel: 624-8423 Fax: 624-8465 E-mail: chang@cs.pitt.edu

Teaching Assistant: Zhixiong Chen
Office: 315 Alumni Hall, Office Hours TuTh 12:30pm-2:00p
Tel: 624-8456 E-mail: zchen@cs.pitt.edu

Recitations: Each student is required to register for one of the two recitations:
Tu 4pm-4:50pm 332 Alumni Hall
Th 4pm-4:50pm 332 Alumni Hall

Course Description: This course is an intermediate-level course in Computer Science for non-CS majors. Its principal objectives are:
(1) To study problem solving using the C programming language and advanced data structures; and (2) To introduce the fundamental concepts of the UNIX operating system, its utilities and the programming of its shell.

Prerequisite: Programming experience in at least one high-level language such as Pascal, FORTRAN or BASIC.

Textbooks: C By Discovery, L. S. Foster, 2nd Edition, Scott/Jones, 1994 (F).

A Practical Guide to the UNIX System, M. Sobell, Benjamin Cummings, 1994 (S).

Class Notes: The class notes were written by Prof. Panos K. Chrysanthis. Notes in postscript form are available on unix in the web page: http://www.cs.pitt.edu/~chang/132/132.html or you can copy all *ps files from the directory: /afs/cs.pitt.edu/usr0/chang/public/html/132

Laboratory: The C programming will be done using Turbo C and Borland C/C++, which run on any IBM compatible PC and Gnu CC (gcc) which runs on any Unix system. These are available in the MIB Lab and CIS Labs.

The SunOS system (Sun Unix system) will be used for the study of UNIX. You can connect to any SunOS system operated by CIS from terminal and PC's in any CIS labs. There is also a dial-up line (621-5954).

To use any CIS operated PC, to connect to any Unix System or to submit any file to one of the university printers, you must use the CAP accounting system to create Unix and Network Accounts.

CIS Labs are: 230 Lawrence Hall, 1E01 Forbes Quad, Hillman Library, G-27/G-62 Cathedral of Learning, 1073/1077 Benedum Hall and Sutherland Hall. Students registered for the current term can use these labs with valid IDs.

NOTICE: All software is for lab use only, so you SHOULD NOT copy anything.

Course Grading:
6 assignments: 40%
2 Exams: 30% Each

Grading Policy:

The grade scaling will be set with respect to only the undergraduate students. Graduate students will then be graded on this undergraduate scale.

The work in this course is to be done independently. Discussions with other students on the assignments should be limited to understanding the statement of the problems. Cheating in any way, including giving the work to someone else, will result in an F in the course.

Each written assignment is due at the beginning of the lecture on the due day of the assignment. You are required to turn in source code of your programs on a 3.5" floppy diskette with a hard copy of each of your programs, and a hard copy of a sample input and output of your programs. You must place them in a yellow office envelope.

A late assignment will receive a deduction of 1 points per day. No assignment which is more than one week late will be accepted.

For the exams, there will be no makeup exams. If you miss the midterm, you will receive a grade equal to 80% of your final exam grade. If you miss the final, you will receive a grade equal to 70% of your midterm exam grade. If you miss both exams, you will receive 0 for both midterm and final.

Outline:

PART I: Basic Unix
1. Introduction to the UNIX operating system (S: Ch. 1 & 2)
2. Introduction to the UNIX utilities (S: Ch. 3)
3. The File System (S: Ch. 4)
4. The Shell (S: Ch. 5)

PART II: C Language
1. Basic Types (F: Ch. 1 & 3)
2. Formatted Input/Output (F: Ch. 1.4 & 1.5)
3. Operators and Arithmetic Expressions (F: Ch. 1 & 3)
4. Functions and Program Structure (F: Ch. 1)
5. Relational and Logical Expressions, and Control Flow (F: Ch. 2 & 6)
6. Type Definition and Enumerate Type (F: 7.5 & 8.5)
7. Arrays and pointers (F: Ch. 4 & 9)
8. Character Strings (F: Ch. 5)
9. Structures and Unions (F: Ch. 7)
10. Input/output on Files (F: CH. 10)
11. C Preprocessor (F: Ch. 11)
12. Abstract Data Types and Storage Classes (F: Ch. 8)
13. Storage Management (F: Ch. 11)

PART III: Unix Shell Programming
1. The C SHell and its Programming (S: CH. 9)
2. The Make, Link and Ar Utilities (S: Ch. 10)

ANSWERS TO ASSIGNMENTS:
Assignment 1
Assignment 2
Midterm Exam