Ryerson University
Department of Computer Science

CPS125 Digital Computation and Programming
Course Outline and Course Management Form (Winter 2014)

Dr. Kosta Derpanis
Office: ENG244
Office hours: Wednesdays 2-3pm (or by appointment)
kosta[at]scs.ryerson.ca

Course Description:
Digital Computation and Programming. The C programming language is used to develop good programming techniques. Topics covered include: C program form, language statements, pseudo-code algorithmic representation, numeric data types, flow of control with selection and repetition, standard C libraries, functions and call modes, arrays, pointers, sorting, matrix operations, character and string data types, dynamic storage, structures and linked lists, file I/O. Only regular first year students from the Faculty of Engineering and Applied Science may preregister for this course.

Course Format:
3 weekly lecture hours and 2 weekly lab hours.

Course Websites:
The official course website (
cps125.scs.ryerson.ca) and your professor's website for specific section information. (must be consulted at least once a week) .
The example programs website can be found at
c.ihypress.com

Course Texts:
*Hamelin, D. (2011), Digital Computation and Programming Workbook, Dubuque: Kendall-Hunt - ISBN: 978-07575-9687-2. (highly recommended)

*Hanly, J. R. & Koffman, E. B. (2012),
Problem Solving and Program Design in C Seventh Edition, Boston: Pearson Publishing.
or
*Hanly, J. R. & Koffman, E. B. (2011),
Problem Solving and Program Design in C - Fourth Custom Edition for Ryerson University, Boston: Pearson Custom Publishing.

*CPS125 Lab Manual (available online from the course website).

Schedule of activities

*Note: The mov video files contain the lecture slides with manual playback enabled.  For Mac users, manual playback works within your browser and within Apple's Quicktime player; unfortunately, this functionality is no longer available by default in OS X Mavericks, you will need to download QuickTime 7 player.  For Windows users, use Apple's Quicktime player to advance the slides manually.

(the material may not necessarily be covered in the exact order given)


Lesson #


Contents / Topics

Readings in
Hanly/Koffman Textbook

Example Programs to Review

Slides
All
Sections

Slides
Sections
1-3


0


Course administrivia





pdf
mov

1

Course introduction. Algorithms. Computer systems. Internal representations. Programming languages. Problem solving. Program development.

Chapter 1



pdf
ppt

Main notes
pdf
mov

Review
pdf
mov

2

Introduction to C: Preprocessor directives. Comments. Structures of C instructions. Program skeletons. Variables. Identifiers. Rules for identifiers. Placeholders (formatting strings). printf and scanf statements. Reading/writing data from/to files (fscanf and frprintf). Reading/writing data from/to files (redirection using scanf and printf). Assignment operator (=).

Chapter 2
(2.1, 2.2, 2.3 2.4, 2.6)

Section 01
(all programs)




pdf
ppt

Main notes
(part1)
pdf
mov

Main notes
(part2)
pdf
mov

3

Variables, Operators, and Expressions: Types of variables. Inaccuracies. Basic data types (int, double, char). Operators (+,-,*,/,%). Memory and pointers. Integer expressions (division). Double expressions. Mixed expressions. Explicit conversion (casting). Unary operator (-). Evaluating expressions (rules). Building expressions. Math functions (math.h). Other functions (abs, rand / stdlib.h). Increment(++) and decrement(--).

Chapter 2
(2.5, 2.7, 2.8)

Chapter 3
(3.1, 3.2)

Chapter 7
(7.1, 7.2)

Section 02
(all programs)






pdf
ppt


Main
notes
pdf
mov

Main notes
(part2)
pdf
mov


4

Logical Operators and Selection Statements: Comparison operators (<, <=, >, >=, ==, !=). Logical operators (&&, ||, !). Evaluating logical expressions. Building logical expressions. Comparing characters. if statements (one alternative, two alternatives, with compound statements, nested). switch statement.

Chapter 4

Section 03
(all programs)




pdf
ppt

Main notes
pdf
mov

Main notes
(part2)

pdf
mov

5

Repetition and Loops I: Theoretical kinds of loops (counting loops, sentinel loops, EOF loops, input validation loops, general loops). Loops in C (while statement, for statement).

Chapter 5
(5.1 to 5.3)

Section 04
(1 to 5)




pdf
ppt

Main
notes
pdf
mov

Review
pdf
mov

5

Loops II: C statements implementing advanced loops. Nested loops. Practical applications.Repetition and Loops II: Loops in C (EOF-controoled loops, do-while statement, input validation loops. Nested loops.

Chapter 5
(5.4 to 5.11)

Section 04
(6 to 10)



Main notes
pdf
mov

Review
pdf
mov

*
(Feb 17-21)

Family Day / Reading Week: No classes/labs.





6

Modular Programming and Functions I: Concepts. Defining functions. Calling functions. Scope of names. Function with value arguments (no arguments/no result, 1 argument/no result, 2 or more arguments/no result, no arguments/1 result, 1 argument/1 result, 2 or more arguments/1 result). Number-Order-Types of arguments/parameters pairs.

Chapter 3
(3.3 to 3.6)

Section 05
(all programs)




pdf
ppt

Main
notes
(part 1)
pdf
mov

Review
(part 1)
pdf
mov

6

Modular Programming and Functions II: Using pointer parameters to simulate multiple results from a function. Recursion.

Chapter 6

Section 06
(all programs)



Main notes
(part 2)
pdf
mov

Review
(part 2)
pdf
mov

7

Arrays I: Numerical arrays of one dimension. Passing such arrays to functions (pointers and arrays). Dynamic allocation of 1D numerical arrays.

Chapter 8
(8.1 to 8.6)

Section 07
(all programs)




pdf
ppt

Main notes
pdf
mov

Review
pdf
mov

7

Arrays II: Multidimensional arrays. Passing such arrays to functions (pointers and arrays). Dynamic allocation of 2D arrays. Basic strings. Case studies.

Chapter 8
(8.7 to 8.9)
Chapter 9

Section 08
(all programs)

Section 09
(all programs)



Main notes
pdf
mov

Review
pdf
mov

7

Structures: The typedef construct. Operations on structures. Structures and functions. Pointers on structures (arrow operator). Linked Lists.

Chapter 11
(11.1 to 11.5)

Section 10
(1 and 2)

pdf
ppt

Main
notes
pdf
mov

Review
pdf
mov

8

Linked Lists. Command line arguments.

Chapter 11
(11.1 to 11.5)

Section 10
(1 and 2)



Main
notes
pdf
mov

Review
pdf
mov


Course review. Review exercises.

Chapter 12

Section 12
(all programs)



Final Review
pdf
mov