Discuss prerequisites. Engineers should take other support course.
Why learn programming?
To increase our understanding of computer technology.
- Tool for solving problems
- Tool for building other tools
- Learn new problem solving skills, reasoning skills
- It's fun. Rewarding to master the computer, create something,
Why programming is more difficult than a typical college course.
Anyone can succeed.
- You have to learn a language including vocabulary and grammar.
- You have to learn design and problem solving methods.
- You have to acquire a new world view: information and
- Learning French and Quantum Physics simultaneously analogy
- Like learning carpentry and architecture simultaneously
- Teaching languages versus Industrial languages
- No slack time. Topics are cumulative. Requires lots of
- Many beginners get an A in the course.
- Computer itself is a teaching aid.
- Lots of resources available.
- Instructor doesn't teach what's in the book, because it's
specific to one language, not general concepts and principles.
The course is titled "Fundamentals of CSC" not "C programming".
- Cope with rapidly changing technology. Half-life of
technological knowledge is 4 years.
- Don't focus on your first job after college, but your nth
- E.g., John has programmed professionally in eleven different
programming languages. And he isn't even a full time developer.
- strategies for learning new tools quickly.
- general problem solving skills: abstraction, decomposition,
- CSc concepts and general principles: algorithms, general
cross-lingual programming concepts. (Not "C" programming).
- Engineering approach to complete software development process.
- Architect vs. Contractor analogy
Example course outcomes
Demo of Playlist Calculator (cp -i
Professional responsibilities lecture - I don't want to teach hackers.
Lecture on Chapter 1
Lecture on Chapter 1 (continue unfinished topics from Wed)
Lecture on Ch 2
Algorithms + data structures = programs
Program Structure - Fig 2.1 (pg 35)
trace technique "a
representation of the dynamic behavior
of static source code."
Evolution of Software
evolves from machine-oriented to
- Models - we are trying to create models of real world phenomenon
that we can manipulate to help us solve problems.
- Building models is easiest if we have tools that use a vocabulary
or notation that closely resembles the problem domain. E.g. WYSIWYG vs
- We want tools that let us express our solutions
using the language of the problem domain and that hide the details of
to Study CSc 101 (Learning Strategies). (Assign Ch 2 reading
due before this topic, so students can compare their current study
habits to those recommended).
- If you encounter a problem that keeps you from moving forward,
contact the instructor.
- Get started on the assignments promptly so if problems occur
there is time to resolve them.
- Attention to detail is a vital skill.
- Start Early
- Get Help: Instructor, tutors, peers
Limit headbanging to 30 min.
Feature overview - C in a nutshell
comparison example: Fuel use - Compute Miles/Gallon in 6
Why C in first course? Party Line: multi-lingual, procedural,
prep for upper division
Summary of Software Development Process - Ch 2 case study (pg 62)
How To Build a Program - a
process for students
Debugging - Categories of Errors
Juggling from lab 1
Example: Calculating UPC check digit
Problem Analysis Strategies - Informal
Recording Log Form
Lectures on Ch 7.1 - 7.3
Character, Integer, Floating Point, Fixed Point, Boolean,
Type checking comparison
Numerical Inaccuracies (precision problems), Bad Money example.
Lecture on Ch 3
Student in-class exercise: Prediction exercise Ch3_1.c
- Procedure: Fig 3.14 pg 120
- Redundant Code example
- Function: Fig 3.21 pg 128, Fig 3.24 pg 133
Practice exercise: Eliminate redundancy in Hypotenuse Program by
Sample explorations: Revenue,
Practice: Write a function to convert Carats to Ounces, given
1 carat = 200mg, 1Kg = 2.2lb
- Input parameters
- Exploration: Fig 3.5 Flat Washers Program, modified to use
circumference and area functions
Standards: Layout, Naming conventions, Comments, etc.
Functions Practice: Pythagorean
- discuss use of functions in this week's lab and programming
Algorithm Building Blocks: Sequence, Selection, Iteration
the Building Block from a problem statement
Discussion: What makes good software? (Background for coding
- Usability, Correctness, Maintainability, Efficiency
- How would you rank them in order of importance?
- Software economics
Lecture on Ch 4.1 Logical Expressions
Forms of selection statements
"if" statement readability issues
- The "true" part of an if statement always follows the "if" and
the "false" part always follows the "else."
Boolean operators: &&,|| vs AND, OR
Uppercase keywords (if allowed)
Nested if vs sequence of if's
Pseudocode (pg 169): Purpose
Structure Diagramming (N-S charts)
trace technique for selection statements
- Example: Table 4.9 pg 164-5
Plans for "if" statements
Test plan demo:
Today is a cold/nice/hot day example
"Minimum Complete Coverage" - the minimum
set of test data that guarantees that each branch in the program is
executed at least once.
and GiveNotice examples
Switch Statements (Ch 4.8)
IF and SWITCH statement pitfalls in C. (CH 4.9)
"Decrease-and-conquer" Problem solving strategy: Reduce a complex
to a simpler one. Math Aptitude test joke.
- Def: a function that returns a boolean value
- You can declare a boolean function and then invoke it as the
conditional in an "if" statement.
of textbook chapter on iteration. (Taxonomy of loop structures)
Pseudocode for loops
Example of Iteration: Submarine Data
Analysis (Solution in 5 languages)
Exercises with Iteration
(This could be a handout for in-class activity)
Table of Cubes data validation loops
example (in Java; need to convert to C)
Directions for how to use the hand
trace technique with iteration, and exercises.
loop defects with a hand trace.
Loop design problems
Strategy Tip: "Don't sweat the small stuff"
- lizard island
- GPA calculation
- circus tax
- car-train collision
- Occurrence of first and last 12 example
Structured vs Unstructured loops; rationale, examples.
Loop design problems (continued)
General Debugging techniques lecture (see notes)
*** Holiday ***
Lecture Ch 6
- Subprograms with output parameters
Incremental Implementation. See "LecPhases" notes.
Stubs and Executing Architecture
Structure Charts lecture (Ch 3.3 and Ch 6)
- First and last 12 example
- "Find the Hurkle" lab activity on previous page.
Lecture Ch 8 Introduction to arrays
Debugging and Testing (Ch 6.6)
Practice with Arrays
Sample array problems:
Soda Tally without arrays and with arrays
Introduce Prime number sieve problem
Exam Scoring problem design activity
Discuss Compare Lists solution.
Lab Exploration: Arrays with non-integer subscripts - letter
count, table lookup
Design activity with arrays and linear search:
- Remove Duplicates problem (paired problem solving)
- Critique instructor solution.
- Compare while vs for loop implementations of search method.
- Compare search vs contains/indexOf
- Comparing design alternatives: tradeoffs.
Lecture CH 9 - Strings
Lecture CH 12 - File Input
CH 2.x Endfile loops
Lecture CH 11 - Records, Arrays of Records
Lecture CH 8.x - Intro to Multi-Dimensional arrays
Multi-D arrays - example problems
Lecture Ch 13 -Programming in the large
- Multiple File Linking
- Implementation versus Interface
Examples and demonstration of multi-file
Course wrapup and Review for final exam