Introduction to Program Design and Concepts

CSCE-121-{501,502,503,504}
Texas A&M University, Spring 2017

Instructors

Michael R. Nowak
Graduate Teaching Fellow
Email: mnowak1[at]illinois[dot]edu
Office hours: Schedule an appointment
J. Michael Moore
Instructional Assistant Professor
Email: jmichael[at]cse.tamu.edu
Phone: (979) 845-5475
Office: HRBB-325
Office Hours: M 14:30-15:00; W 14:00-15:00

Teaching Assistants

Nitish Chandra
Sections: 501, 504
Email: nitishchandra[at]tamu.edu
Office: RDMC-B021
Office Hours: M/W 17:30-19:00
Binbin Li
Sections: 502, 503
Email: jeremyli[at]email.tamu.edu
Office: HRBB-311A
Office Hours: T/R 11:00-12:00, 13:00-14:00
Keishla Ortiz-Lopez
Email: keishla.ortiz4[at]tamu.edu
Office: RDMC-B021
Office Hours: T/R 11:00-13:00

Announcements

Apr. 24
Homework 13 (Image Viewer) has been released
Apr. 17
Homework 12 (Temperature Queries Pt. 2) has been released
Apr. 10
Homework 11 (Temperature Queries Pt. 1) has been released
Apr. 03
Homework 10 (Store Backend Pt. 3) has been released
Mar. 27
Homework 9 (Store Backend Pt. 2) has been released
Mar. 20
Homework 8 (Store Backend Pt. 1) has been released
Mar. 06
Homework 7 (Palindromes) has been released
Feb. 27
Homework 6 (Mountain Paths Pt. 2) has been released
Feb. 20
Homework 5 (Mountain Paths Pt. 1) has been released
Feb. 13
Homework 4 (Bulls & Cows Pt. 2) has been released
Feb. 09
Exam 1 coverpage published; access through this link
Feb. 06
Homework 3 (Bulls & Cows Pt. 1) has been released
Feb. 01
Extra credit opportunities released; access document through this link
Jan. 30
Homework 2 has been released
Jan. 23
Homework 1 has been released
Jan. 19
You can download the self-assessment prerequisite problem set for this course here.

Schedule

Week Date Lecture Lab Reading Notes
1 Jan-18 Introduction & course overview Claim csce accounts; connecting to the csce servers; navigating the command line; using the vi line editor; working from home Stroustrup: 1.1-5 (skim), 1.6
Zybook: Chpt. 1 (optional)
 
1 Jan-20 Data representation (S)
  • Positional Number Systems
  • Binary Number System
  • Binary Addition
  • Binary Subtraction
  • Binary Multiplication
  • Binary Division
- Stroustrup: Chpt. 2, A.17, 4.1-2
Zybook: Chpts. 2-3
Zybook challenge (but not participation) activities required (due Jan-25)
2 Jan-23 Data representation (S)
  • Decimal complements
  • Binary complements
  • Integral number representation
  • Character data representation
  • Significant digits
  • Normalized exponential form
  • Floating-point number representation
  • Rounding rules
  • Rounding vs. truncating
  • Propogation of errors
  • Conversion errors
  • Cancellation errors
Objects, types, and values
Establish lab teams; flowcharts and design documents Stroustrup: Chpt. 3, 24.2, B.9.1, B.9.2, A.2.0-5, A.1.3, A.3, A.4.1, A.5.2.2, A.8.0 (pg 1099 only), A.11, B.8.1, B.8.2, A.7
Zybook: Chpts. 4-5
Zybook challenge (but not participation) activities required
Homework 1 Announced
Two's complement notes
2 Jan-25 Objects, types, and values (S)
  • Basic terminology
  • Boolean type
  • Character types
  • Integer types
  • Floating-point types
  • Enumerations
  • Void type
Variables w/ memory diagrams
Version control; step-wise compiling through the command line Stroustrup: Chpt. 3, 24.2, B.9.1, B.9.2, A.2.0-5, A.1.3, A.3, A.4.1, A.5.2.2, A.8.0 (pg 1099 only), A.11, B.8.1, B.8.2, A.7
Zybook: Chpts. 4-5
Zybook challenge (but not participation) activities required (due Feb-01)
2 Jan-27 Objects, types, and values (S)
  • Declarations and definitions
  • Declaration structure
  • Names
  • Scope
  • Initialization & assignment
  • Type safety
  • Safe conversions
  • Unsafe conversions
Variables w/ memory diagrams (S)
  • Memory layout
  • Memory diagrams
Selection (S)
  • if-statements
  • Switch-statements
- Stroustrup: 4.0-4.4.1, A.5.2.0-A.5.2.2, A.5.3, A.5.5
Zybook: Chpts. 6-7
Homework 1 Design Document Due
Zybook chpts. 6-7 all activities (challenge and participation) required (due Feb-03)
3 Jan-30 Software development process (S)
  • Analysis
  • Design
  • Implementation
Analysis and design example (S)
  • Quadratic equation solver
Team editor set-up
Switch statements
Type safety, conversion notes
Stroustrup: 24.2, 6.1-6.2
Homework 2 Announced
Code for quadratic formula solver developed in lecture
3 Feb-01 Program Flow (S)
  • Sequence
  • Selection
  • Iteration
Iteration (S)
  • Loop parts and terminology
  • Creating a loop
  • While-statements
  • Do-while-statements
  • For-statements
  • Nested-loop example
  • Types of control
  • Loop conversion
Intro references/pointers; arrays/vectors and structures (S)
  • Intro to pointers
  • Intro to references
Grains of Wheat
Loop Conversion
Stroustrup: 4.4.2
Zybooks: 8-9
Homework 1 Implementation Due
Extra Credit Opportunities Announced
Zybook chpts. 8-9 all activities (challenge and participation) required (due Feb-08)
3 Feb-03 Intro references/pointers; arrays/vectors and structures (S)
  • Array overview
  • Pointers and arrays
  • vector overview
  • Growing an empty vector
  • Structures overview
Search (S)
  • Linear search
  • Binary search
Sorting (S)
- Stroustrup: 4.6.0, 4.6.1, 4.6.2, 4.6.3, 4.6.4, 4.7, 18.6.0, 24.3, 24.4
Zybooks: Chpts. 10-11
Homework 2 Design Document Due
Zybook chpts. 10-11 all activities (challenge and participation) required (due Feb-10)
ArrayExample.cpp
VectorExample.cpp
PointerExample.cpp
ReferenceExample.cpp
StructExample.cpp
BinarySearch.cpp
4 Feb-06 Errors and Exceptions (S)
  • Compile-time errors
  • Link-time errors
  • Run-time errors
  • Logic errors
  • Handling local run-time errors
  • Handling non-local run-time errors
    • Caller deals with the error
    • Callee deals with the error
    • Error reporting
    • Exceptions
Vector Stats
Vector Median
Stroustrup: Chpt. 5
Zybooks: Chpt. 12
Homework 3 Announced: Bulls & Cows Pt. 1
Zybook chpt. 12 all activities (challenge and participation) required (due Feb-13)
4 Feb-08 Errors and Exceptions (S)
  • Exceptions : Throw, Try and Catch
I/O Overview (S)
  • Input and output model
  • The stream model : istream
  • The stream model : ostream
  • Stream state
    • Stream state flags
    • Stream state functions
    • Data validation
  • Formatting output
    • Integer output
    • Floating-point output
    • Output fields
    • Field adjustment
Multiplication Tables
Input Validation
Stroustrup: 4.1, 10.1, 10.2, 10.6, 10.7, 11.1, 11.2, 11.5, 11.6
Zybooks: Chpt. 13
Homework 2 Implementation Due Zybook chpt. 13 all activities (challenge and participation) required (due Feb-15)
4 Feb-10 File I/O (S)
  • General process
  • Resource acquisition is initialization (RAII)
  • "The old fashioned way"
Unnecessary Censorship Example
- Stroustrup: 10.3, 10.4, 10.5, 10.11, 11.3, 11.7 Exam 1 material through today
Homework 3 Design Document Due
Unnecessary Censorship Example (incomplete code)
5 Feb-13 Function technicalities pt1 (S)
  • Functions overview
  • Programming goals
  • Benefits of functions
  • Declaring and defining a function
  • Calling a function
  • Function placement
  • Stack frames and function calls
  • Pass-by-value
I/O Manipulator Lab
getline & extraction(>>) Lab
Stroustrup: pg. 47, 4.5, 8.1-8.2, 8.5-8.5.2, 8.5.8
Zybooks: Chpt. 14-15
Homework 4 Announced: Bulls & Cows Pt. 2
Zybook chpt. 14-15 all activities (challenge and participation) required (due Feb-20)
5 Feb-15 Exam 1 File I/O Lab   Homework 3 Implementation DueHomework 3 Due Feb-16 by 23:59
5 Feb-17 Function technicalities pt2 (S)
  • Pass-by-value
  • Pass-by-reference
- Stroustrup: 8.5.3-8.5.7, 8.6
Zybooks: Chpt. 16-17
Homework 4 Design Due
Zybook chpt. 16-17 all activities (challenge and participation) required (due Feb-24)
6 Feb-20 Function technicalities pt3 (S)
  • Command-line parameters
  • Command-line parameter example
  • Default parameters
  • Default parameter example
  • Function overloading
  • Function overloading example
Median-by-value
Median-by-ref
Pass-by-const-reference
Stroustrup: 10.7.1 (review)
Zybooks: 14.1-3 (review), 14.6-8 (review), 15.3-4 (review), 16.1-3 (review)
Homework 5 Announced: Mountain Paths Pt. 1
6 Feb-22 Function technicalities pt4 (S)
  • Recursion
    • How recursion works
    • Recursion example
Functionize Tic-Tac-Toe Stroustrup: 8.5.8 (review)
Zybooks: Chpt. 18-19
Homework 4 Implementation Due
Zybook chpt. 18-19 all activities (challenge and participation) required (due Mar-01)
6 Feb-24 Function technicalities pt5 (S)
  • Exceptions with functions
    • How exceptions work with functions
    • Exceptions with functions example
  • Code Organization
- Stroustrup: 5.5 (review), 5.6 (review)
Zybooks: 15.2 (review)
Homework 5 Design Due
7 Feb-27 Code organization example
Testing functions (S)
Function overloading
Add and handle an exception
Zybooks: Chpt. 18-19 (review) Homework 6 Announced: Mountain Paths Pt. 2
7 Mar-01 Recursion maze solver example (S) Code organization
Default parameters
  Homework 5 Implementation Due
RecursiveMazeSolverInClass.cpp
7 Mar-03 Objects Overview (S)
Classes Pt. 1 (S)
  • Writing a class
  • Class members
  • Member visibility
  • Default visibility (S)
  • Mutators and accessors
Debugging (S)
- Zybooks: Chpts. 20-21 Last day for Exam 1 regrade requests
Homework 6 Design Due
Zybook chpt. 20-21 all activities (challenge and participation) required (due Mar-10)
8 Mar-06 Classes Pt. 2 (S)
  • Class constructors
  • Overloading constructors
  • Code organization
IDE Debugger
Recursion
Stroustrup: Chpt. 9
Zybooks: Chpts. 20-21 (review)
Recall Zybook chpt. 20-21 all activities (challenge and participation) due Mar-10
Homework 7 Announced: Palindromes
8 Mar-08 Classes Pt. 3 (S)
  • Class guidance
  • Return-by-reference
  • Operator overloading
Modeling Classes with UML (S) Class attributes, methods, getters and setters
UML
Stroustrup: Chpt. 9 (review)
Zybooks: Chpts. 20-21 (review)
ConstMemberSet.cpp
CinWordCount2.cpp
IncompleteClassReturnByRef.cpp
Homework 6 Implementation Due
8 Mar-10 Classes Pt. 4 (S)
  • Overloading the << operator
  • const in classes
  • static in classes
- Stroustrup: Chpt. 9 (review)
Zybooks: Chpts. 20-21 (review)
Homework 7 Design Due
- Mar-13 No Lecture/Labs: Spring Break
- Mar-15 No Lecture/Labs: Spring Break
- Mar-17 No Lecture/Labs: Spring Break
9 Mar-20 A program in memory (S)
  • Anatomy of a program in memory
  • Allocation of memory to variables
  • Allocation of memory to program code
  • Allocation of memory for class instances
  • Class identifier resolution
Introduction to namespaces (through modular programming) (S)
  • Procedural programming
  • Modular programming
  • Namespaces
  • Modular programming : stack example
  • User-defined types : stack example
  • Abstraction
  • Information hiding
  • Encapsulation
Class Constructors
Class Attributes : Set Once
  Homework 8 Announced: Store Backend Pt. 1
9 Mar-22 Class example Return-by-reference
Operator== overloading
Zybooks: Chpt. 22 Homework 7 Implementation Due
Zybook chpt. 22 all activities (challenge and participation) required (due Mar-29)
Book class example
9 Mar-24 Dynamic memory introduction (S)
  • Memory layout review
  • Heap, dynamic memory
  • Resource acquisition is initialization (RAII)
  • Pointers to classes & structs
How dynamic memory works (S)
- Zybooks: Chpt. 23 Homework 8 Design Due
Zybook chpt. 23 all activities (challenge and participation) required (due Mar-31)
10 Mar-27 Dynamic memory management (S)
  • Memory leaks
  • Managing memory
  • Strategies to manage dynamic memory
  • Classes and dynamic memory
How dynamic memory leaks occur (S)
Arrays and pointers (S)
  • Arrays
  • cstrings
  • Importance of arrays
Overloading '+=' Operator with Const
  Homework 9 Announced: Store Backend Pt. 2
10 Mar-29 Exam 2 Output Operator Overloading
  Homework 8 Implementation Due
10 Mar-31 Dynamic Memory Cont. (S)
Linked List Intro (S)
- Stroustrup: Chpt. 17 Homework 9 Design Due
Dynamic-array backed stack code
11 Apr-03 Dynamic structures, singly linked lists, and destructors (S)
  • Dynamic structures
  • Dynamic structures examples
  • Singly linked list
  • Destructors
  • Destructor example
Dynamic memory
Memory leaks
Zybooks: Chpts. 22-23 (review) Homework 10 Announced: Store Backend Pt. 3
11 Apr-05 Dynamic Memory Allocation, Copy Challenges (S)
  • Shallow copy
  • Deep copy
  • Copy constructor
  • Copy assignment operator
Implement LinkedList from slides, including constructor, destructor, a traversal (that prints each item), and our insert method -- have your TA check off what you've compelted by the end of the lab Zybooks: Chpts. 22-23 (review) Homework 9 Implementation Due
11 Apr-07 rvalues and lvalues, rvalue References, and Move Semantics (S)
Essential class operations (S)
- Zybooks: Chpts. 22-23 (review) Homework 10 Design Due
MyLinkedList.zip
12 Apr-10 Essential class operations (S)
Inheritance overview (S)
Anatomy of inheritance (S)
Destructors
Copy assignment operator
Move constructor [optional, but highly recommended]
  1. Zybooks: Chpt 24
  2. Review that code associated with rule of three/five in MyLinkedList.zip
  3. Read Strong Typing vs. Weak Typing vs. Static Typing vs. Dynamic Typing
Homework 11 Announced: Temperature Queries Pt. 1
As always, assigned Zybook chpt(s). (here, 24) activities (challenge and participation) required and due one-week from being assigned (chtp. 24 is thus due on Apr-17)
12 Apr-12 Inheritance Pt. 2 (S)
Polymorphism (S)
Linked List: Adding after a value
UML Class diagram with inheritance
Zybooks: Chpt. 25
Stroustrup: 14.2.1, 14.2.2, 14.2.4, 14.3, 14.4, 18
Homework 10 Implementation Due
As always, assigned Zybook chpt(s). (here, 25) activities (challenge and participation) required and due one-week from being assigned (chtp. 25 is thus due on Apr-19)
12 Apr-14 No Lecture/Labs: Reading Day Homework 11 Design Due
13 Apr-17 Lecture will be given by Dr. Moore :
Polymorphism (S)
Anatomy of Polymorphism (S)
Polymorphism & Pointers (S)
Inheritance Stroustrup: 14.2.1, 14.2.2, 14.2.4, 14.3, 14.4, 18 (review) Homework 12 Announced: Temperature Queries Pt. 2
Michael Nowak at conference ; his office hours are canceled from today through Monday, April 24
13 Apr-19 Lecture will be given by Dr. Moore :
Polymorphism Example
Object Oriented Programming (S)
Graphics & FLTK (S)
Inheritance & Graphics (S)
Using FLTK Zybooks: Chpts. 24, 25 (review) Homework 11 Implementation Due
Michael Nowak at conference ; his office hours are canceled through Monday, April 24
13 Apr-21 Lecture will be given by Dr. Moore :
Shapes Example
FLTK Images (S)
FLTK Image Example
Event Driven Programming (S)
-   Homework 12 Design Due
Michael Nowak at conference ; his office hours are canceled through Monday, April 24
14 Apr-24 Lecture will be given by Dr. Moore :
Event Driven Programming: handle (S)
Event Driven Programming: callback (S)
Examples
Buttons with Images
Extending the Shape Class
Zybooks: Chpt. 27 Zybook chpt. 27 all activities (challenge and participation) required (due May-1)
Homework 13 Announced: Image Viewer
Michael Nowak at conference ; his office hours are canceled through today (resume tomorrow)
14 Apr-26 Abstract Data Type, Generic Programming, Templates (S) FLTK Events: callbacks
FLTK Events: handle
Stroustrup: Chpt. 19 Homework 12 Implementation Due
14 Apr-28 Template Example (H | S) - Zybooks: Chpt. 26 Homework 13 Design Due
Zybook chpt. 26 all activities (challenge and participation) required (due May-2)
15 May-01 STL Intro and Model (S) Templates
FLTK Events: handle
Stroustrup: Chpt. 20 GenericSelectionSort
GenericStack
FLTK-ColorButton Example
15 May-02 Review
-
Stroustrup: Chpt. 21 (skim) Homework 13 Implementation Due
Extra Credit Due
  May-08 Final Exam (0800-1000)

Syllabus

It appears you don't have a pdf plugin for this browser. You can click here to download the pdf file.

Please click here to access the syllabus pdf file.