Bryn Mawr College
CS 246: Programming Paradigms (C and Unix Programming)
Spring 2012
Course Materials

 

 

 

 Information

Texts  Important Dates  Projects  Lectures  Grading  Links

 

General Information

Instructor: Dianna Xu , 246A Park Hall, 526-6502
E-Mail: dxu at cs dot brynmawr dot edu
WWW: http://cs.brynmawr.edu/~dxu


Lecture Hours: Mondays & Wednesdays, 2:30pm to 4 pm
Room: Park 336

Lab Hours: Mondays or Wednesdays 4-6pm (not both)
Lab room: Park 232

Office hours: M/Th 4-5pm

TA hours: Tuesdays (or Sundays) 8-10pm

Texts & Software

 


 

Purchase

  • C Programming: A Modern Approach, by K. N. King, W. W. Norton & Company, 1996.
  • Programming with GNU Software, by Andy Oram and Mike Loukides, O'Reilly, 1996.

Reference

  • The C Programming Language, Second Edition, by Brian Kernighan & Dennis Ritchie, Prentice Hall, 1988.
  • The Unix Programming Environment , by Brian Kernighan & Rob Pike, Addisson-Wesley, 1984.


Important Dates

 

Jan 17: First lecture
Apr 28: Last lecture


Programming Projects & Homework

 

Future home works will be posted here and/or handed out in class.


Lectures

Planned Syllabus

 

Week Topic
1 Introduction to Unix and C
2 types, char, scanf, conditionals and loops, gcc and gdb
3 Functions and Scope, program design, the C preprosessor and header files
4 pointers, arrays and pointers. Multiple source files, makefile
5 pointers and function arguments, File I/O, redirection and pipes
6 Strings, strings wrt pointers, string.h, commandline arguments
7 Malloc, memory management, multi-directional arrays
8 Spring Break!
9 Structures, typedef, unions, enums. Linked lists
10 Adavanced use of pointers, function pointers, writing large programs
11 Low level programming, bitwise ops. Object-oriented programming, intro to C++
12   Arrays, pointers & strings in C++. Data abstraction in C++ using classes. Operator Overloading in C++. Friend functions and classes
13   ADT's in C++.
14 Implementing Linked Lists in C++. Templates: Function templates and class templates. Exception Handling, Inheritance and subclasses, C++ standard library
15 Presentations, Wrap up  

 

Detailed syllabus will be posted here as the semester progresses


  • Week1

    Jan 18:
    Introduction to Free Software, Open Source, UNIX, Linux, history of evolution of UNIX and C.

    Homework (due Wednesday 1/25): Write a short 2-3 page essay on Open Source Software in latex.

    Lab: latex intro. latex handout another latex handout



  • Week 2

    Jan 23: Introduction to C: Basic program structure, declarations and statements, variables and types. Introduction to Linux: kernel, shell, filesystem. Compiling and running C programs.

    Presentation topics and reading list

    Read: Chapter 1-2, 3.1, 4.1, 7.1 and 7.2 from King and skim 1-3 from O&L.

    Jan 25 : Characters in C. Control statements: assignment, increment/decrement operators, shortcut operators, if-statement, while-statement and logical operators. I/O using scanf.

    Read:
    Chapters 3.2, 5 and 7.3 - 7.5 from King, skim chapter 4 from L&O.

    Lab: Linux: navigating directories, basic shell commands, Emacs, printing, etc. Compiling and running C programs.

    Read: lab01 handout.


    (due Wednesday 2/1): homework1

  • Week 3

    Jan 30
    : For loops, more on loops. Arrays, arrays and loops. Char handling and misc library functions.

    Read: Chapters 6, 8.1 and 23.4 from King.

    February 1: Functions and scope. Parameter passing.

    Read:
    Chapters 9 from King.

    Lab: More unix, tcsh. gcc and gdb

    Read: Chapter 6 from L&O, lab02 handout

    (due Wednesday 2/13): homework2


  • Week 4

    February 6: Program organization. The C Preprocessor: #define, #ifdef, #ifndef, and #include directives. Conditional compilation.

    Read: Chapters 10.1, 10.3, 10.4 and 14 from King.

    February 8: Number systems. Introduction to pointers and memory.

    Read:
    11.1 - 11.3 from King.


    Lab: prototypes, header files, preprosessor directives

    Read: lab03 handout
  • Week 5

    February 13: Pointers as function arguments, return values. Pointers and arrays.

    Read: Chapter 11 till the end, chapter 12 from King.

    (due Thursday 2/16): homework3

    February 15 : File I/O

    Read:
    Chapter 12 from King.

    Lab: Unix file I/O, pipes and redirection


    Read: lab04 handout

  • Week 6

    February 20: File I/O continued

    (due Wednesday 2/29): homework4

    February 22: Strings and string.h

    Read:
    Chapter 13 from King.

     


  • Week 7

    February 27: Memory management, malloc and free

    Read: King 17.1 - 17.4

    Lab: Strings

    Read: lab05 handout

    February 29: Class cancelled, I am out of town.

     


  • Week 9

    March 12: Memory management, malloc and free, continued

    Read: King 17.1 - 17.4

    (due Monday 3/19): homework5a

    (due Wednesday 3/21): homework5b

    (due Wednesday 3/28): homework5c

    March 14: Unix utilites: cat, echo, sort, grep, cut, head, tail, find and at

    Read: Unix man pages regarding the specific commands.

  • Week 10

    March 19: Makefile and gdb

    Read:
    lab07 handout

    Lab: Makefile and gdb

    March 21: Structs, typedefs and enums

    Read: King chapter 16

  • Week 11

    March 26: Regular Expressions

    Read:
    Unix man pages on grep/egrep, pay particular attention to the regular expression section. Any other online resources on regular expressions. There are numerous.

    March 28: Self-referential structures and linked list

    Read: King 17.5

    (due Monday 4/2): homework6


  • Week 12

    April 2: Advanced use of pointers, function pointers

    Read:
    King 17.6-17.7 and 22.6-22.7

    (due Wednesday 4/28): homework7

    April 4: Low-level programming

    Read: King Chapter 20

  • Week 13

    April 9: C++

    April 11: Film screening: To Dream Tomorrow - A Portrait of Ada Byron Lovelace


 


Grading

All graded work will receive a score out of 100. Guidelines of letter grades corresponding to lab/exam score levels will be given during the semester. At the end of the semester, a total score (to which the corresponding final grade is assigned) will be calculated from a weighted average of all scores according to the following weights:

Programming Assignments: 70%
Presentation: 15%
Written Homeworks: 15%
Total: 100%

A list of presentation topics and related reading materials will be given out. Each student should hand in a written report as well as do a class presentation and lead class discussion on the topic. More details will be given out during class.


Links

Unix for Beginners

Basic Unix Tutorial

Unix FAQ

Emacs howto

LaTeX primer

Beginning LaTeX

Class examples

Lecture notes and lab notes