CS 202 Fall 2013: Computer Science II

CS 202 Fall 2013
Computer Science II

Department: Computer Science, UAF
Instructor: Glenn G. Chappell
Office: 201B Chapman
Office Hours: 10:45–1:45 MWF on fall 2013 class days, or by appointment
Office phone: (474-)5736
E-mail: ggchappell@alaska.edu
Paper mailbox: Inside the CS Department office, 202 Chapman

Announcements

Course Materials

Materials are listed with the most recent at the top.

Week Class Meetings Readings & Homework Handouts & Code
Finals 
12/16–12/19 
  • 12/19: Final Exam 8–10 a.m. in the classroom
   
Week 14 
12/9–12/13 
  • 12/12: General review
  • 12/10: Introduction to recursion (cont’d)
  • Challenge for 12/12
    Instructions for in-class lab work, Thursday, December 12
    Posted Thu 12/12
  • test_quicksort.cpp [C++ source]
    Test program for function template quicksort
    Requires quicksort.h
    Used in class Thu 12/12
  • quicksort.h [C++ header] UNFINISHED
    Header for function template quicksort
    There is no associated source file
    Used in class Thu 12/12
Week 13 
12/2–12/6 
  • 12/5: Introduction to recursion (cont’d) [19.1–19.2]
  • 12/3: Queues [18.4–18.6]; the deque container [18.6]; introduction to recursion [19.1–19.2]
  • 12/3: Read 19.1–19.1
  • Challenge for 12/5
    Instructions for in-class lab work, Thursday, December 5
    Posted Thu 12/5
  • binsearch.h [C++ header] UNFINISHED
    Header for function template binSearch: Binary Search
    There is no associated source file
    Used in class Thu 12/5
  • test_binsearch.cpp [C++ source]
    Test program for function template binSearch
    Requires binsearch.h
    Used in class Thu 12/5
  • Challenge for 12/3
    Instructions for in-class lab work, Tuesday, December 3
    Posted Tue 12/3
  • test_ispal.cpp [C++ source]
    Test program for function isPal
    Requires ispal.h, ispal.cpp
    Used in class Tue 12/3
  • fibo1.cpp [C++ source]
    Computing Fibonacci numbers
    Version #1: recursive
    Written Tue 12/3
  • fact.cpp [C++ source]
    Factorial: recursive & iterative
    Written Tue 12/3
  • usequeue.cpp [C++ source]
    Example using std::queue
    Written Tue 12/3
Week 12 
11/25–11/27 
  • 11/28: No class (Thanksgiving)
  • 11/26: Stacks [18.1–18.3]
    Notes
  • 11/26: Read 18.4–18.6.
  • Challenge for 11/26
    Instructions for in-class lab work, Tuesday, November 26
    Posted Tue 11/26
  • rpncalc.cpp [C++ source] UNFINISHED
    Reverse Polish Notation expression evaluation
    Example application of a stack
    Used in class Tue 11/26
  • usestack.cpp [C++ source]
    Example using std::stack
    Written Tue 11/26
Week 11 
11/18–11/22 
  • 11/21: Linked lists: variations & STL container [17.4–17.5]
  • 11/19: Linked lists: implementation & operations [17.1–17.2]
  • 11/19: Read 18.1–18.3.
  • Assignment 7
    Due 2 p.m. Mon 11/25
    Posted Tue 11/19
  • 11/19: Read 17.4–17.5.
  • Challenge for 11/21
    Instructions for in-class lab work, Thursday, November 21
    Posted Thu 11/21
  • Challenge for 11/19
    Instructions for in-class lab work, Tuesday, November 19
    Posted Tue 11/19
  • uselist1.cpp [C++ source] UNFINISHED
    Simple main program for class template List1
    Used in class Tue 11/19
  • list1.h [C++ header]
    Header for class template List1
    Singly Linked List node class
    There is no associated source file
    Used in class Tue 11/19
Week 10 
11/11–11/15 
  • 11/14: Class canceled
  • 11/12: The Standard Template Library (cont’d) [16.5]
  • 11/12: Read 17.1–17.2.
  • Challenge for 11/12
    Instructions for in-class lab work, Tuesday, November 12
    Posted Tue 11/12
Week 9 
11/4–11/8 
  • 11/7: The Standard Template Library [16.5]
  • 11/5: Defining templates [16.3]; class templates [16.4]
    Notes
  • Assignment 6
    Due 2 p.m. Wed 11/13
    Posted Thu 11/7
  • 11/7: No new reading.
  • 11/5: Read 16.5.
  • a06e_input1.txt [Text file]
    Sample input file for Assignment 6 Exercise E
    Posted Thu 11/7
  • Challenge for 11/7
    Instructions for in-class lab work, Thursday, November 7
    Posted Thu 11/7
  • domenu.cpp [C++ source]
    Skeleton program with menu
    Used in class Thu 11/7
  • Challenge for 11/5
    Instructions for in-class lab work, Tuesday, November 5
    Posted Tue 11/5
  • test_waitinline.cpp [C++ source]
    Test program for class template WaitInLine
    Requires waitinline.h
    Used in class Tue 11/5
Week 8 
10/28–11/1 
  • 10/31: Exceptions (cont’d) [16.1]; function templates [16.2]
    Notes
  • 10/29: Exceptions [16.1]
    Notes
  • 10/31: Read 16.3–16.4.
  • 10/29: Read 16.2.
  • Challenge for 10/31
    Instructions for in-class lab work, Thursday, October 31
    Posted Thu 10/31
  • multiprint.cpp [C++ source]
    Exceptions & function templates
    Used in class Thu 10/31
  • functemp.cpp [C++ source]
    Demo of function templates
    Written Thu 10/31
  • Challenge for 10/29
    Instructions for in-class lab work, Tuesday, October 29
    Posted Tue 10/29
  • trydiv.cpp [C++ source]
    Error handling using exceptions
    Used in class Tue 10/29
  • excep.cpp [C++ source]
    Demo of exceptions
    Written Tue 10/29
Week 7 
10/21–10/25 
  • 10/24: Midterm Exam
  • 10/22: General review
    Notes
  • 10/24: Read 16.1.
 
Week 6 
10/14–10/18 
  • 10/17: Object-oriented programming: abstract base classes [15.7]; object-oriented programming: polymorphic objects in containers
    Notes
  • 10/15: Object-oriented programming: virtual functions & polymorphism [15.6]
    Notes
  • 10/17: No new reading.
  • Assignment 5
    Due 2 p.m. Mon 10/21
    Posted Tue 10/15
  • 10/15: Read 15.7.
  • fancyprint_test.cpp [C++ source]
    Test program for class FancyPrint & derived classes
    Requires header/source for classes tested
    Used in Assignment 5, Exercise A
    Written Sat 10/19
  • Challenge for 10/17
    Instructions for in-class lab work, Thursday, October 17
    Posted Thu 10/17
  • func.h [C++ header]
    Header for class Func
    Used in class Thu 10/17
  • func.cpp [C++ source]
    Source for class Func
    Used in class Thu 10/17
  • Challenge for 10/15
    Instructions for in-class lab work, Tuesday, October 15
    Posted Tue 10/15
  • strprint.h [C++ header]
    Header for class StrPrint
    Used in class Tue 10/15
  • strprint.cpp [C++ source]
    Source for class StrPrint
    Used in class Tue 10/15
Week 5 
10/7–10/11 
  • 10/10: Object-oriented programming: introduction [15.1–15.5]
    Notes
  • 10/8: Classes II: operator overloading (cont’d) [14.5]; classes II: aggregation [14.7]
    Notes
  • 10/10: Read 15.6.
  • 10/8: Read 15.1–15.5.
  • Challenge for 10/10
    Instructions for in-class lab work, Thursday, October 10
    Posted Thu 10/10
  • Challenge for 10/8
    Instructions for in-class lab work, Tuesday, October 8
    Posted Tue 10/8
  • test_event.cpp [C++ source]
    Test program for class Event
    Requires modified versions of event.h, event.cpp
    Used in class Tue 10/8
  • event.h [C++ header] UNFINISHED
    Header for class Event
    Used in class Tue 10/8
  • event.cpp [C++ source] UNFINISHED
    Source for class Event
    Used in class Tue 10/8
  • test4_timesec.cpp [C++ source]
    Test program #4 for class TimeSec
    Requires modified versions of timesec.h, timesec.cpp
    Used in class Tue 10/8
Week 4 
9/30–10/4 
  • 10/3: Classes II: operator overloading (cont’d) [14.5]
    Notes
  • 10/1: Classes II: operator overloading [14.5]
    Notes
  • Assignment 4
    Due 2 p.m. Wed 10/9
    Posted Thu 10/3
  • 10/3: Read 14.7.
  • 10/1: No new reading.
  • dollarcent_test.cpp [C++ source]
    Test program for class DollarCent
    Requires modified versions of dollarcent.h, dollarcent.cpp
    Used in Assignment 4, Exercise A
    Written Thu 10/3
  • dollarcent.h [C++ header] UNFINISHED
    Header for class DollarCent
    Holds an amount of money in dollars & cents
    Written Thu 10/3
  • dollarcent.cpp [C++ source] UNFINISHED
    Source for class DollarCent
    Holds an amount of money in dollars & cents
    Written Thu 10/3
  • Challenge for 10/3
    Instructions for in-class lab work, Thursday, October 3
    Posted Thu 10/3
  • test3_timesec.cpp [C++ source]
    Test program #3 for class TimeSec
    Requires modified versions of timesec.h, timesec.cpp
    Used in class Thu 10/3
  • test2_timesec.cpp [C++ source]
    Test program #2 for class TimeSec
    Requires modified versions of timesec.h, timesec.cpp
    Used in class Thu 10/3
  • Challenge for 10/1
    Instructions for in-class lab work, Tuesday, October 1
    Posted Tue 10/1
  • test_timesec.cpp [C++ source]
    Test program for class TimeSec
    Requires modified versions of timesec.h, timesec.cpp
    Used in class Tue 10/1
  • timesec.h [C++ header] UNFINISHED
    Header for class TimeSec
    Holds a time of day in seconds
    Practice for operator overloading
    Written Tue 10/1
  • timesec.cpp [C++ source] UNFINISHED
    Source for class TimeSec
    Holds a time of day in seconds
    Practice for operator overloading
    Written Tue 10/1
Week 3 
9/23–9/27 
  • 9/26: Dynamic allocation [9.8]; classes II: the copy constructor [14.4]
    Notes
  • 9/24: Classes II: some details [14.1–14.3]
    Notes
  • 9/26: Read 14.5.
  • Assignment 3
    Due 2 p.m. Wed 10/2
    Posted Thu 9/26
  • 9/24: Read 9.8, 14.4.
  • Challenge for 9/26
    Instructions for in-class lab work, Thursday, September 26
    Posted Thu 9/26
  • hasarray_main.cpp [C++ source]
    Driver for class HasArray
    Requires hasarray.h, hasarray.cpp
    Written Thu 9/26
  • hasarray.h [C++ header]
    Header for class HasArray
    Demo of dynamic allocation, copy ctor
    Written Thu 9/26
  • hasarray.cpp [C++ source]
    Source for class HasArray
    Demo of dynamic allocation, copy ctor
    Written Thu 9/26
  • Challenge for 9/24
    Instructions for in-class lab work, Tuesday, September 24
    Posted Tue 9/24
  • test_countme.cpp [C++ source]
    Test program for class CountMe
    Requires files implementing class CountMe
    Used in class Tue 9/24
  • dosumup.cpp [C++ source]
    Driver for class SumUp
    Requires sumup.h, sumup.cpp
    Written Tue 9/24
  • sumup.h [C++ header]
    Header for class SumUp
    Has static member and friend
    Written Tue 9/24
  • sumup.cpp [C++ source]
    Source for class SumUp
    Has static member and friend
    Written Tue 9/24
Week 2 
9/16–9/20 
  • 9/19: Classes I day 4 [Ch 13]
    Notes
  • 9/17: Classes I day 3 [13.11–13.12]
    Notes
  • Assignment 2
    Due 2 p.m. Wed 9/25
    Posted Fri 9/20
  • 9/19: Read 14.1–14.3.
  • 9/17: No new reading.
  • wodget_main.cpp [C++ source]
    Main program for class Wodget
    Used in Assignment 2 Exercise A
    Posted Fri 9/20
  • print_from_ptrs.cpp [C++ source]
    Program for you to finish
    Used in Assignment 2 Exercise C
    Posted Fri 9/20
  • Challenge for 9/19
    Instructions for in-class lab work, Thursday, September 19
    Posted Thu 9/19
  • test_starrect.cpp [C++ source]
    Test program for class StarRect
    Requires files implementing class StarRect
    Used in class Thu 9/19
  • dofancyprinting.cpp [C++ source]
    Driver for class FancyPrint
    Demo of objects in a container
    Requires fancyprint.h, fancyprint.cpp
    Written Tue 9/17
  • fancyprint.h [C++ header]
    Header for class FancyPrint
    Class with a private member function
    Written Tue 9/17
  • fancyprint.cpp [C++ source]
    Source for class FancyPrint
    Class with a private member function
    Written Tue 9/17
  • Challenge for 9/17
    Instructions for in-class lab work, Tuesday, September 17
    Posted Tue 9/17
  • test_name.cpp [C++ source]
    Test program for class Name
    Requires files implementing class Name
    Used in class Tue 9/17
Week 1 
9/9–9/13 
  • 9/12: Classes I day 2 [13.6–13.10]
    Notes
  • 9/10: CS 201 recap (cont’d) [Ch 1–12]; classes I day 1 [13.1–13.5]
    Notes
  • 9/12: Read 13.10–13.12.
  • Assignment 1
    Due 2 p.m. Fri 9/20
    Updated Thu 9/12
  • 9/10: Read 13.6–13.9.
  • clock_main2.cpp [C++ source]
    Another main program using class Clock
    Requires clock.h, clock.cpp
    Written Thu 9/12
  • clock_main.cpp [C++ source]
    Simple main program using class Clock
    Requires clock.h, clock.cpp
    Written Tue 9/10
  • clock.h [C++ header]
    Header for class Clock
    Holds a time of day in seconds
    Written Tue 9/10
    Modified Thu 9/12
  • clock.cpp [C++ source]
    Source for class Clock
    Holds a time of day in seconds
    Written Tue 9/10
    Modified Thu 9/12
  • usepointer.cpp [C++ source]
    Example using pointers
    Written Tue 9/10
  • usestruct.cpp [C++ source]
    Example using a struct
    Written Tue 9/10
  • usevector.cpp [C++ source]
    Example using std::vector
    Written Tue 9/10
Week 0 
9/5–9/6 
  • 9/5: Course overview; CS 201 recap [Ch 1–12]
    Notes
  • 9/5: Read 13.1–13.5.
    Note: The above date is when the reading is assigned. It should be done by the next class meeting (Tuesday 9/10 in this case).

External links last checked November 26, 2013.
UAF Blackboard
UAF’s Blackboard site. In this class Blackboard will be used for homework submission, but not for anything else.
cplusplus.com
A very nice general C++ information site. Includes reference information, tutorials, articles, and forums.
cppreference.com
An excellent C++ reference site. It seems to have dreams of being a more general information site, but it is not there yet. OTOH, this is my favorite site for looking up C++ Standard Library functions. Includes complete (?) reference information about both C++11 and C++14.


CS 202 Fall 2013 / Updated: 17 Dec 2013 / Glenn G. Chappell