Chabot College Fall 2002 Course Outline for Computer Science 18A

advertisement
Chabot College
Fall 2002
Course Outline for Computer Science 18A
C PROGRAMMING IN THE UNIX/LINUX ENVIRONMENT
Catalog Description:
18A - C Programming in the UNIX/Linux Environment
2 units
Intended for students with knowledge of a high-level programming language, such as C++ or Java.
Introduction to the C programming language, particularly the differences between C and C++ or
Java. Programming in the UNIX/Linux environment. Variables, control structures, functions and
parameter passing, strings, pointers, memory management, linked lists, recursion, the preprocessor
(macros, libraries), command-line parameters, and use of the command-line compiler. Prerequisite:
Computer Science 14 and Computer Science 41 (both completed with a grade of C or higher).
Strongly recommended: Eligibility for English 1A and Computer Science 15 or Computer Science
19A. 1.5 hours lecture, 1.5 hours laboratory.
Prerequisite Skills:
Before entering the course the student should be able to:
1. follow the procedures used in the appropriate college computer laboratory to sign in and out, and
to write, edit, compile, run and debug programs;
2. demonstrate an elementary understanding of modern computational systems and their use;
3. demonstrate an elementary understanding of what steps are involved in program development;
4. use simple C++ data types in programs and understand how they are represented in the
machine;
5. form C++ expressions using selected operators, and understand the rules of precedence used in
their evaluation;
6. use the structured programming constructs: sequence, selection and iteration;
7. perform elementary interactive input and output operations;
8. code void and value-returning functions with value and reference parameters and use them in a
program;
9. define and use the structured C++ data types: array, string, struct in applications drawn from
mathematics, the sciences, and other areas;
10. use text files to record and retrieve information in elementary applications;
11. produce well-documented, user-friendly programs of short to medium length.demonstrate the
procedures used in the appropriate college computer laboratory to sign in and out, edit, compile,
run and debug programs;
12. display a basic knowledge of UNIX operating system capabilities, history, evolution, and identify
major variants;
13. differentiate capabilities of a multi-user operating system, UNIX, from those of a single-user
system such as Windows 95/98/NT;
14. identify the components of a UNIX system: file system, utilities, shell (command interpreter),
kernel;
15. use UNIX commands to log on and off a UNIX/Linux system and change passwords;
16. use UNIX commands to manage files and directories;
17. identify various UNIX shells, identify the login shell and recognize shell variables;
18. redirect input and output, pipe commands, and run commands in the background;
19. use (in a basic way) tools such as grep, find, cut, paste, join, sort;
20. send, receive, and manage electronic mail;
21. use the vi and/or emacs text editors;
22. edit, compile and run a simple C program under UNIX;
23. identify, locate, and use UNIX-based Internet resources;
24. use top-down design methods, be able to develop algorithms and programs of intermediate
difficulty and length in the C++ language; including programs broken into several files;
Chabot College
Course Outline for Computer Science 18A
Fall Semester 2002
Page 2
Prerequisite Skills: continued
25. possess knowledge of major features of the C++ language including classes, operator and
function overloading, inheritance, virtual functions and polymorphism;
26. specify algorithms for and code elementary searches and sorts;
27. possess a thorough working knowledge of C++ simple data types, operator precedence, C++
operators, and control structures;
28. demonstrate working capabilities in pointer use and manipulation;
29. demonstrate an understanding of the concept of input/output streams and their use in a wider
range of C and C++ input/output functions, both interactive and file;
30. identify object oriented programming concepts;
31. demonstrate an understanding of the concepts of scope and class of variables: local vs. global,
automatic vs. static, external, register;
32. use the structured C++ data types, arrays, structs, and classes;
33. demonstrate knowledge of how the computer represents integers and be able to do base
conversions;
34. construct truth tables and use to evaluate relational expressions involving bitwise and relational
operators.
Expected Outcome for Students:
Upon completion of this course the student should be able to:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
identify the differences between the C and C++ programming languages;
define, at a high level, the internal representation of variables in C programs;
design, write, debug, and document well-structured programs of medium length in the C
language, using selection and iteration constructs, simple text files, one- and twodimensional arrays, value-returning and void functions, pointers, memory management
functions (malloc() and free()), and linked lists;
use C-strings with the C string library;
use the cc or gcc C compilers for UNIX or Linux;
use the most-used standard C libraries under UNIX and Linux;
design and write macros to implement small tasks in a consistent, modular way;
design and write a recursive function in C;
use conditionally-compiled code and use other features of the preprocessor;
implement a reference parameter using a pointer;
use C library functions to allocate and de-allocate memory for use in linked data structures,
particularly linked lists;
use command-line parameters from within a C program.
Course Content:
1.
The C programming language
a.
Differences between C and C++
b.
Command-line compilers (cc or gcc)
c.
Atomic variables (integer, floating-point, pointer) and their representation
d.
Control structures (sequential execution, if, if/else, switch, for, while, do-while,
function call)
e.
Functions (arguments, parameters, return values)
f.
Composite variables (one- and two-dimensional arrays, structs, unions) and their
representation
g.
C-strings
h.
Standard C library (string.h, math.h, stdio.h stdlib.h, others)
i.
Preprocessor (macros, header files, conditional compilation)
Chabot College
Course Outline for Computer Science 18A
Fall Semester 2002
Page 3
Course Content: continued
2.
3.
4.
Data structures and programming methods
a.
Linked lists
b.
Recursion
UNIX/Linux programming
a.
UNIX C library
b.
UNIX file system and standard file I/O (fopen(), fclose(), etc.)
c.
Processing command-line arguments (wild cards, expanded by the shell)
d.
Memory management (malloc(), free())
Optional content (if time permits)
a.
Make utility
b.
Goto and why you don't often use it
c.
More of the standard C library
d.
Overview of the UNIX kernel, processes, memory management
Method of Presentation:
1.
2.
Lecture
In-class example programs with explanations and demonstrations
Assignments and Methods of Evaluating Student Progress:
1.
Typical assignments:
a. Several short to medium length programs illustrating concepts from lecture, such as:
1) A simple problem using I/O and math, e.g., a calculator
2) A filter, e.g., cat, echo, more, pg
3) A stream file I/O problem
4) A 2-dimensional array problem
5) A C-string problem
6) A linked-list problem
7) A bitwise data packing problem (i.e., simple data compression)
8) A raw file I/O problem
2.
Methods of evaluation:
a. Midterm exams
b. Short quizzes
c. Final exam
Textbook(s) (Typical):
The C Programming Language, Brian W. Kernighan and Dennis M. Ritchie, Prentice-Hall,
1998
Special Student Materials:
Computer lab fee
Diskettes
Optional zip disk
Keith Mehl July 2001
CS 18A Outline Fall 2002
hps
Download