CSCI 1300 - Fall 2011

Taught by Michael Main (Office ECOT 738)

Course Links

Programming Homework

Most weeks will have a programming homework that is due Friday at 10pm. Late homework is accepted through 10am on the following Monday with a 10% penalty. During the semester, you may also submit two very late homeworks--which must be submitted no later than 11:59pm on the following Wednesday (five days after the original due date). These very late homeworks always have a 13% late penalty.

The two very late homeworks are intended to deal with all situations throughout the semester, such as unexpected delays. Please don't ask for more than two very late submissions.

Complete homework submission instructions are online at www.portmain.com/intro/submit.html.

All assignments will use C++ along with a graphics library called WinBGIm. This graphics library is available only on Windows machines. Keep in mind that your programs will often go beyond what's presented in the textbook since we'll use the WinBGIm functions from day one. The lectures and recitations are your primary source of information about WinBGIm.

Special Deal: If your last homework is not your lowest homework score, then it will count twice and I will drop your lowest other homework score.

All the programming assignments taken together count as half of your course grade.

Exams

There will be four exams, one of which is the comprehensive final exam. Taken together, these four equally-weighted exams count as half of your course grade.

Calendar

This calendar shows my plan, but the actual lectures are likely to get ahead or behind the calendar at times. Some topics are not in the textbook. I will post my daily short notes from time to time.

Topics Homework
1. Week of Aug 22. Overview of C++ and Winbgim
Topics:

  • C++ language elements (read §1.1).
  • Reserved words and identifiers (read §1.2)
  • Data types, variables and constants (read §1.3)
  • Introduction to executable statements (read §1.4)
  • The WinBGIm graphics library (read §2.8)
  • A little programming style (read §1.5)
  • Arithmetic expressions (read §1.6)
  • ---Test your understanding: My Programming Lab §1.3, 2.1, 2.2 and 2.3

Sample programs:

  dayone.cxx (draws two circles)
  snowmen.cxx

You'll find problems on myprogramminglab.com to test your understanding and to help you prepare for our exams. Each week, I will list the most useful problems in the Topics part of this calendar. You don't have to submit anything because the problems are just for your learning (not for a grade).

No homework due this week, but please read the sections listed under this week's topics. Several topics throughout the semester are not in the book, so, don't miss class and come to office hours if needed!

To do your work on your home pc, you may download and install the CS 1300 Software. Please download the file and double-click on it to install the The g++ compiler, emacs, ... for your pc

You may also install windows on your mac: www.cs.colorado.edu/~main/mac/ . The link describes free tools to install windows on a mac, including the instructions for getting a free student copy of windows itself.

Recitation: No recitation in Week 1.
2. Week of Aug 29. Top-Down Design with Functions
Topics:

  • Review the snowmen program
  • Michael's trigonometry lesson
  • Tilting the heads of your snowmen!
  • Samples of program design (read §2.1)
  • Calling library functions such as sin and cos (read §2.2)
  • Writing your own functions without parameters (read §2.3-2.4)
  • Writing your own functions with parameters (read §2.5-2.6)
  • ---Test your understanding: My Programming Lab §4.1, 4.2, 4.3 and 4.4

Sample programs:

 

  tiltmen.cxx (tilted snowmen!)
spinmen.cxx (spinning snowmen!)

Continue your textbook reading and do practice problems at myprogramminglab.com.

HW 1 (Drawing Shapes) due 10pm on Friday evening, Sep 2. Please read the caution about doing your own work and follow the submission instructions.

Recitation: Recitation Exercise #1 Using emacs and g++
3. Week of Sep 5. Animation, Errors, and Style
Topics:

  • Introduction to animation (in class only!)
  • What errors have you seen? (read §1.8 and §2.9)
  • Ten items from the Colorado Style Guide that you'll be required to use starting with Homework #2
  • Interview with Josée Lajoie (read pages 63-64)
  • ---Test your understanding: My Programming Lab (no new problems)

Sample programs:

 
robot.cxx (animated)
Notes on periodic functions

Continue your textbook reading and do practice problems at myprogramminglab.com.
Recitation: Practice with Recitation Exercise #2 Using the debugger
4. Week of Sep 12. Introduction to C++ Control Structures
Topics:

  • Control structures (read §3.1)
  • Boolean expressions (read §3.2)
  • Introduction to if-statements (read §3.3-3.4)
  • Introduction to while-loops (read §4.1-4.2)
  • Iterative solution to an equation (in class only!)
  • ---Test your understanding: My Programming Lab §2.4, 2.5, 3.1, 4.1, 4.2

Sample programs:

 
android.cxx
solvers.cxx (Solving equations)

HW 2 (Moving Shapes) due 10pm on Friday, Sep 16.
Recitation: Recitation Exercise #3 Loops in the debugger
5. Week of Sep 19. More Branching
Topics:

  • Design issues (read §3.5-3.6)
  • Nested if-statements (read §3.7)
  • Switch-statements (read §3.8)
  • Revisting errors (read §3.9)
  • Converting between coordinate systems (in class only!)
  • ---Test your understanding: My Programming Lab §3.2 and 4.3

Sample programs:

 
solvers.cxx (distance and estimate_pi)

HW 3 (Functions) due 10pm on Friday, Sep 23.
Recitation: Homework help
6. Week of Sep 26. More Looping
Topics:

  • The for-loop (read §4.3)
  • Typical looping patterns (read §4.4-4.5)
  • Drawing parametric curves (in class only!)
  • The do-while loop and guidelines for choosing a loop (read §4.6-4.7)
  • Nested loops (read §4.8)
  • Revisiting the debugger (read §4.9)
  • Revisiting the animation loop (read §4.10)
  • Revisting errors (read §4.11)
  • ---Test your understanding: My Programming Lab §3.3, 3.4

Sample programs:

 
projectile.cxx
cubic-curve.cxx
catmull-rom-spline.cxx

HW 4 (Orbit) is due at 10pm on Friday, Sep 30.
Recitation: Recitation Exercise #3A More loops
7. Week of Oct 3. Exam, Mice, and Reference Parameters
The first exam will be during our usual lecture, on on Monday, Oct 3. It will be cover all lecture material, programming assignments, and assigned reading from the first six weeks of class. A practice exam is now available from a previous semester. The topics we've covered this semester might be slightly different, but the practice exam will give you a good idea of the kind of question to expect.
Topics after the exam:

  • A few more simple function examples (read §5.1)
  • Reference Parameters (read §5.2)
  • Getting the coordinates of a mouse click (in class only!)
  • Mouse clicks in world coordinates (in class only!)
  • An interactive Newton projectile program (in class only!)
  • The Catmull-Rom parametric cubic curve (in class only!)
  • Interactive Catmull-Rom Spline (in class only!)
  • Interview with my former TA Mark Hall (read pages 142-144)
  • ---Test your understanding: My Programming Lab Chapter 5

Sample programs:

 
projectile-with-mouse.cxx

No homework due this week.
Recitation: No recitation this week, but the TAs will be available for individual consultation during the usual recitation time.
8. Week of Oct 10. More about Function Design
Topics:

  • Preconditions and postconditions (read §5.3)
  • Stubs and drivers (read §5.4)
  • The assert macro (read §5.5)
  • The Mandelbrot fractal (in class only!)
  • Expanding the Mandelbrot fractal to 451 colors (in class only!)
  • The lunar lander program (in class only!)
  • Drawbacks of writing simulations with Euler's method
  • Interview with Mark Weisert (read pages 279-280)
  • ---Test your understanding: My Programming Lab (no new problems)

Sample programs:

 
mandelbrot-16.cxx
mandelbrot-451.cxx
lander.cxx
a jpg of the moon!

Homework 5 (Gravity Field) is due at 10pm on Friday, Oct 14.
Recitation: Work on Homework #5.
9. Week of Oct 17. Lots More Function Practice
Topics:

  • Functions that return a bool value
  • The bisection algorithm
  • Static variables (in class only)
  • Lots of practice writing functions (in class only)
  • ---Test your understanding: My Programming Lab (no new problems)

Sample programs:

 
is.cxx (boolean functions)

Homework 6 (Flying Ship) is due at 10pm on Friday, Oct 21.
Recitation: Exam practice.
10. Week of Oct 24. Exam, Input, Output and Graphing
The second exam will be during our usual lecture, on on Friday, Oct 28. It will be cover all lecture material, programming assignments, and assigned reading through Week 9. Week 10 topics will not be on this exam. You may use these practice questions and their solutions to help study, but keep in mind that some topics might not appear in those samples.
Topics (not on the exam):

  • Passing a Function as a Parameter (in class only!)
  • Modifying Bisection to Use a Function as a Parameter (in class only!)
  • Graphing a Function (in class only!)
  • Estimating an Area from Its Graph (in class only)
  • Streams and Basic File I/O (read §6.1)
  • Tools for Stream I/O (read §6.2)
  • ---Test your understanding: My Programming Lab Chapter 6

Sample programs:

 
b_and_i.cxx (bisection and integration)

No homework due this week.
Recitation: Lab Exercise 5: File Input/Output. There is good textbook material on this topic, but we might not cover it much other than this recitation!
11. Week of Oct 31. Arrays
Topics:

  • Leftover topics from Week 10
  • Introduction to arrays (read §7.1-7.3 and §8.1-8.6)
  • ---Test your understanding: My Programming Lab §7.1 and 7.2

Sample programs:

 
puppy.cxx

Homework 7 (Photo) is due at 10pm on Friday, Nov 4.
Recitation: Homework help.
12. Week of Nov 7. Multidimensional Arrays
Topics:

  • Arrays in winbgim (read §8.12)
  • Multidimensional arrays (read §7.4 and §8.7)
  • Matrix multiplication (in class only!)
  • Markov systems (in class only!)
  • Errors with arrays (read §8.13)
  • ---Test your understanding: My Programming Lab § 7.3 and 7.4

Sample programs:

 
array.cxx
sortetc.cxx Notes from 11/11/11

Homework 8 (Array Manipulation) is due at 10pm on Friday, Nov 11.
Recitation: Exam practice
13. Week of Nov 14. Introduction to Structs
The third exam will be during our usual lecture, on on Monday, Nov 14. It will be cover all lecture material, programming assignments, and assigned reading through Week 12. A set of practice exam questions is available online.
Topics after the exam:

  • Structs (read §8.8)
  • Structs as parameters (read §8.9)
  • Arrays of structs (read §8.10)
  • ---Test your understanding: My Programming Lab § 10.1

Sample programs:

 

Homework 9 (Sound Visualizer) is due at 10pm on Friday, Nov 18.
Recitation: Homework help
14. Week of Nov 28. Introduction to STL Classes
Topics:

  • A brief introduction to pointers (read §10.1)
  • Dynamic arrays (read §10.2)
  • The String class (read §2.7)
  • Strings as arrays of characters (read §8.11)
  • The Vector class (read §9.1) vectors.cxx and author.cxx
  • ---Test your understanding: My Programming Lab Chapter 8

Sample programs:

 

Homework 10 (Wire-Frame 3D) is due at 10pm on Friday, Dec 2. There is no late penalty for work submitted through 10am on Monday, Dec 5. If you have not used your two very late submissions, then you may submit this as a very late assignment any time before 11:59pm on Wednesday, Dec. 7 with a 13-point late penalty.
Recitation: Recitation Exercise Using C-Style Strings
15. Week of Dec 5. Final Topics
Topics:

Sample programs:

 

Homework 11 is due at 9:00pm on Friday, Dec 9. Late work is accepted until 10am on Monday, Dec 12 with no penalty. Note that no very late work is accepted for this assignment. The final submission time is at exactly 10am on Monday, Dec 12. Please don't leave it until the last minute because computer problems could cause you to not be able to submit.
Recitation: Final exam review.
Final Exam
The final exam will be comprehensive with multiple-choice questions. It will be in our regular classroom at the time listed on the registrar's final exam schedule. A past exam is available for you to peruse.