Pitt Logo SIS Logo

Department of Information Science and Telecommunications

 

INFSCI 0012 - Introduction to Programming

(Spring 2004, CRN 29578)


[ Formal Data | Course Tools | Syllabus | Course Books | Course Schedule | Course Materials | CourseWeb | KnowledgeTree ]


Course Materials

Lecture Objectives Readings Handouts
Lecture 1
Introduction
Introduction to the course. Programming and programs. Karel the Robot. Karel World. First Karel program. Pattis:
Introduction; Chapter 1
Tutorial:
Lessons 1, 2, and 3
Slides
Lecture 2
Simpe Programs
Karel basic commands. Compilation and errors. Defining new instructions. Block. Pattis:
Chapter 2 (with exercises)
Chapter 3, Sections 3.1 - 3.4
Tutorial:
Lessons 4
Slides
Lecture 3
Program design
Programs with new instructions. Programming as problem solving. Stepwise refinement. Design Tree. Pattis:
Complete Chapter 3

Slides
Lecture 4
Conditional Execution
Conditions. If-then instruction. If-else instruction. Pattis:
Chapter 4
Tutorial:
Lessons 6, 7, 9
Slides
Lecture 5
Loops
Iterate loop. While loop. Embedded loops. Loop invariants. Desinging loops. Pattis:
Chapter 5
Tutorial:
Lessons 8, 11
Slides
Lecture 6
Advanced programming with Karel
Nested while loop. Loops with conditional statements. Recursion Pattis:
Chapter 5, Sections 5.7-5.8
Chapter 6, Sections 6.1
Slides
Lecture 7
Introduction to C
C logistics. First C program. C tools, compilation and errors Perry:
Chapter 1; Chapter 2 (until "Kinds of Data"); Chapter 3 (first run)
Slides
Lecture 8
Data Types and Expressions
C Data Types. Arithmetic operations. Using printf. Print formatting specifications. Perry:
Chapter 2 (starting from "Kinds of Data"); Chapter 4; Chapter 9 (first run)
Slides
Lecture 9
Variables
Variables. Declaration and initialization. Assignment. Numeric data types. Implicit type conversion. Program readability. Comments. Program design. Perry:
Chapter 3; Chapter 5; Chapter 9
Slides
Lecture 10
Simple Programs
Defined constants. Preprocessor. Input. Simple programs with input. Perry:
Chapter 7; Chapter 8
Slides
Lecture 11
Simple Loops
Expressions. Statements. Block. While loop. Increment and decrement. Compound assignmenmts (+=; -=; *=; /=, %=). Perry:
Chapter 10; Chapter 14 (first run)
Slides
Lecture 12
Loops and tables
Relational operators (< > <= >= != ==); Programming patterns. Printing tables with while loop; Counter-controlled and sentinel-controlled loops. Summing up an input. while loop vs. until loop; After this lecture you should get a good understanding of basic loops and be able to write simple programs with counter-controlled and sentinel-controlled loops, in particular, programs that process and print tables Perry:
Chapter 11: Testing data; Chapter 14
Slides
Lecture 13
Conditionals
If and if-else control structures. Nested Ifs, ifs inside loops. Calculating min and max. Conditional operator. Perry:
Chapter 11; Chapter 13: Hello Conditional
Slides
Lecture 14
Character Processing
Char data type. Typecasting. Char input and output. Filter programs. Perry:
Chapter 10: Typecasting; Chapter 18.
Slides
Lecture 15
Complex Conditions
Else-if construct. Logical operators. Programs with complex conditions. Perry:
Chapter 12
Slides
Lecture 16
For and Switch
More examples of complex conditions. Switch. Switch vs. else-if.For loop. For loop vs. while loop. Perry:
Chapter 15; Chapter 17
Slides
Lecture 17
Array Processing
Arrays. Array input and output. Array processing with for. Perry:
Chapters 20 to 22
Slides
Lecture 18
Functions
Functions. Parameter passing by value. Function prototypes. Perry:
Chapter 30; First reading of to Chapters 31 and 32
Slides
Lecture19
Arrays and Functions
Prameter passing by value and by refernce. Character arrays, strings, processing, initializing, and printing strings. Perry:
Chapters 6, 31, 32
Slides
Lecture 20
Nested Loops
Nested loops, bar charts, string search. Reading and processing standard input line by line. Perry: Chapter 19, Chapter 22
Slides
Lecture 21
Pointers
Memory and variables. Pointers. Operations with pointers. Pointers and functions. Pointers and arrays. Address Arithmetic. Pointers and char arrays. Perry: Chapter 24. Chapter 25 (First reading)
Ted Jensen:
Pointers and Arrays in C: Chapters 1-4
Stanford CS Ed. Library:
Pointers and Memory
Slides
Lecture 22
Two-Dimensional Arrays
Two-Dimensional Arrays. Arrays of Pointers. Perry: Chapter 25. Chapter 26
Ted Jensen:
Pointers and Arrays in C: Chapters 6-9
Slides
Lecture 23
Recursion
Recursive defintions, Recursive functions. Implementation of recursion. Perry:
Slides

 

Copyright © 2003 Peter Brusilovsky