Course website for...

Computer Science I (20-CS-121) Summer 2008
23 June -- 28 July, 2008

Course Information

Class:MWF 12:30 - 2:20pm in 533 Baldwin Lab:MW 2:30 - 6:20pm in 860D Baldwin
Teacher:Ryan Flannery Phone:(859) 750-3088
Office:805B Rhodes Hall Office Hours: TH 12:30 - 2:30pm and by appointment!
Website: Email:
BlackBoard: BlackBoard will be used for grades and class-wide emails only. You may access UC's BlackBoard site here.

Syllabus and Schedule

Below are links to the syllabus and schedule for this class.
NOTE REGARDING THE SCHEDULE: The schedule can, and probably will, change as the course proceeds. This is typical with condensed classes such as this. Anytime the schedule is updated, it will be announced both in class and on this website.

Course Updates & News

Any news/updates to the class will be announced below.
  1. Monday, 23 June 2008: First day of class and lab. I'll take a survey of the class to see when office hours would best be scheduled.
    Also, the first homework assignment (homework 0) is made! (see below for the assignment)
  2. Monday, 23 June 2008 - Roaming Lab: As expected, our assigned Lab is scheduled to be used by other, more important people. As such, we'll be using lab 860B Baldwin for at least the first week of the quarter (it's right next to 860D). After the first week, we should be back in 860D.
  3. Wednesday, 25 June 2008: Some of you were interested in downloading the free edition of Visual Studio C++ Express online. The download can be found at the following website:
    (The download for the C++ version is on the bottom right.)
    Note that if you have the 6th edition of the text book, the CD contains this program already.
  4. Thursday, 26 June 2008 - Office Hours Canceled: It seems I have been drafted to help with the summer camp for computer science going on this week here at UC (these are the kids who have stolen our lab). I'll be working with the camp today until 3pm, which means I must cancel my office hours.

    If you would like to meet, please send me an email and after I am finished with the camp, we can try to setup a time!
  5. Friday, 27 June 2008 - Emails and BlackBoard: I have decided to use BlackBoard for sending class-wide emails, as this is preferred way to do so at UC. As such, I need each of you to login to BlackBoard and make sure the email address in your profile is the one you wish to use for any communication! By default, this email address is your UC email address.

    Additionally, if you are auditting this class, please let me know after class so that I can add you to the BlackBoard class list.
  6. Monday, 30 June 2008 - Grades & Lab Labs 1 and 2 and Quiz 1 have been graded and will be handed back today. Additionally, the grades have been posted to BlackBoard.

    Also Remember that today we are supposed to return to our home-lab of 860D (which is next-door to where we were last week).
  7. Monday, 7 July 2008 - Midterm Review!
    Have questions prepared before class!
  8. Wednesday, 9 July 2008 - Midterm!
    This is not a class you want to miss! Remember that after the exam, class will resume as normal and attendance will be taken!
  9. Friday, 11 July 2008 - Quiz 3!
    Two days of exams and quizzes... does it get any better?
  10. Wednesday, 16 July 2008 - Homeworks 6 & 7.
    Class, we will be having one less homework than scheduled in the syllabus. To accomodate this, Homework 6 (assigned today!) will be elevated to 70 points. Homework 7 (the final project) will be worth 80 points, and assigned on Monday.
  11. Friday, 25 July 2008 - Quiz 5 Cancelled and Lab 9
    Class, Quiz 5 has been cancelled. Additionally, Lab 9 is officially worth 10 points (not 20). Anyone who succeeded in the second task received up to 10 extra credit points.

    Becuase of the above, the class will be graded out of 980 points rather than 1,000 points.
  12. Tuesday, 29 July 2008 - Class is Over!
    What are you doing checking this site... relax!
    NOTE: All sample solutions on this site have now been disabled

Lectures & Notes

Below are the lectures given in the course. For each lecture, the slides as they are shown in class are provided, along with a more printer-friendly handout version.
Please note that these lecture notes are subject to change!
  1. What is Computer Science? A brief history of where CS came from, where it's at now, and where it might go in the future.
    Download: slides, handout.
  2. Diving into C++. Basics about what C++ is and how to program. Includes basics about Microsoft Visual Studio.
    Download: slides, handout.
  3. A Visual Guide to Visual Studio C++. Includes creating projects, adding files, and ZIP'ing your projects.
    View Online: view.
  4. Basic Input/Output in C++. A brief overview of cin & cout, with just enough information for you to start using them effectively.
    View Online: view.
  5. C++ Data Types and Operators. Covers the various C++ data types, some of their associated operators, casting, and constants.
    Download: slides, handout.
  6. C++ Scope Rules. Covers the scope of variables in C++, what that is, and how it works.
    Download: slides, handout.
  7. C++ Control Structures. Covers if, if/else, and switch.
    Download: slides, handout.
  8. C++ Looping Structures. Covers while, do-while, and for.
    Download: slides, handout.
  9. Design Overview. An overview of the process of writing good software.
    Download: slides, handout.
  10. Design Example. An example of the software design process using Lab 3 as an example.
    Download: slides, handout.
  11. Money Magazine Report. Money magazine and 2007 report on Best Jobs in the U.S. rates the job of Software Engineer as the number one job for growth, pay, and stress levels.
    Download Excerpts: slides, handout.
  12. Outline of Midterm Topics. What you should know for the midterm on Wednesday.
    Download: slides, handout.
  13. Style Guide. (A) C++ Coding Style Guide. How to properly write code so that any programmer can read your code and know what it is doing.
    Download: slides, handout.
  14. Functions. Feel the power! An introduction to defining, using, confusing, and understanding functions in C++. They offer immense power, are a great tool for high-level design, and can greatly simplify your work in this class... if you use them correctly!
    Download: slides, handout.
  15. Arrays & Vectors. The basics of declaring, using, and abusing C++ arrays. Also includes a brief overview of the C++ STL vector class.
    Download: slides, handout.
  16. Searching & Sorting. A brief introduction to key concepts of searching lists (arrays or vectors) and sorting them.
    Downlaod: slides, handout.
  17. Pointers. An introduction to C++ pointers.
    Downlaod: slides, handout.
  18. Outline of Final Exam Topics. What you should know for the final exam on Friday.
    Download: slides, handout.

Example Source Code

Below is all of the sample C++ source code presented in class.
  1. Data Types Code illustrating the various data types in C++ as well as some introductory use of control structures.
    View: click here.
  2. Control Structures Code working with the C++ control structures if, if/else, and switch.
    View: click here.
  3. Scope Code working with C++ blocks and scope rules.
    View: click here.
  4. Looping Structures Code working with the C++ looping structures while, do-while, and for.
    View: click here.
  5. Functions Code working with C++ functions.
    View: click here.
  6. Arrays Code working with C++ arryas.
    View: click here.
  7. Vectors Code working with the C++ STL vector class.
    View: click here.
  8. Searching & Sorting How to search and sort arrays/vectors.
    View: click here.
  9. Reading in Files How to read in files using C++.
    View: click here.
  10. Lab 4 Solutions Code using "carriage returns" in output, complicated looping structures with nested control structures, and various mathematical goodies.
    View: click here.
  11. Working with Cards for BlackJack Code used for working with cards in the game of blackjack.
    1. Cards.cpp. Basic card handling routines.
    2. BlackJackOutline.cpp An outline of a solution. It does not take into account the problems with Aces.
  12. Example source code from Quizzes: ALL SOLUTIONS HAVE BEEN DISABLED.
  13. Example source code from Lab Solutions: ALL SOLUTIONS HAVE BEEN DISABLED.
  14. Example source code from Homework Solutions: ALL SOLUTIONS HAVE BEEN DISABLED.

Lab Assignments

For each lab, a (relatively) small project will be assigned that is to be completely during the lab. They will be posted here just before the lab. Remember that you are allowed to drop your lowest lab score, except for the last lab -- that one is mandatory!
  1. Lab 1, Monday 23 June 2008: 3 tasks. Basic usage of Visual Studio and creating your first (simple) C++ program. Diagnosing common error messages and debugging programs. Extending an existing program.
    View: click here.
  2. Lab 2, Wednesday 25 June 2008: 3 tasks. Basic usage of control structures.
    View: click here.
    Comments and Sample Solution: click here.
  3. Lab 3, Monday 30 June 2008: Looping. 2 tasks: reivisitng lab 2 and calculating debt.
    View: click here.
    Task 1 Sample Solution: click here.
    Task 2 Sample Solution: See the "Design Example" lecture above. In it, the software design principles we covered in class (in the "Design Overview" lecture) are applied to this lab.
  4. Lab 4, Wednesday 2 July 2008: Approximating π.
    View: click here.
    Sample Solution: Basic (html), Fancy (html).
  5. Lab 5, Monday 7 July 2008: 3 tasks: understanding sequences, creating your own pow function, and creating your own round'ing functions.
    View: click here.
    Sample Solution: click here.
  6. Lab 6, Wednesday 9 July 2008: The hunt for the perfect number...
    View: click here.
    Sample Solution: click here.
  7. Lab 7, Monday 14 July 2008: Measuring the randomness of rand() when using mod (%).
    View: click here.
    Sample Solution: click here.
  8. Lab 8, Wednesday 16 July 2008: Working with arrays and functions. Creating functions to display, shuffle, and search a music playlist.
    View: click here.
  9. Lab 9, Monday 21 July 2008: Building a selection sort, both recursively and non-recursively.
    View: click here.
    Sample Solution: click here.
  10. Lab 10, Wednesday 23 July 2008: Reading files in C++ and getting a headstart on the final project.
    View: click here.
  11. Lab 11, Monday 28 July 2008: To be posted later.
    NOTE: This lab is MANDATORY!
    View: click here. The final exam will be during the class immediately before this lab. As such, if you make it to the final exam you can make it to this lab!
    Additionally, this lab may not be dropped from your grade!

Homework Assignments

All homework assignments will be posted below.
  1. Homework 0: Assigned: Monday, 23 June. Due: ASAP.
    This homework is in 3-parts:
    1. Send me an email ASAP, with your name in it, from an email account you wish to use for this class. This will be used for class communication.
    2. IF you are an engineering student THEN please make sure your engineering computer account is setup by going to the lab (860D Baldwin) and making sure you can login. If it is not setup, go to the OCC office in 636 ERC.
      IF you are not an Engineering student THEN you will need a temporary engineering account setup by going to 636 ERC.
    3. The reading for the course is officially assigned as follows:
      • Chapters 1, 2, and Chapter 4 up to (and including) section 4.6 are to be read before the end of Week 1.
      • Chapter 3, the rest of Chapter 4 and all of Chapter 5 are to be read before Week 2 starts (so, over the weekend!)
      • Chapter 6 is to be read before Week 3 starts.
      • Chapter 7 is to be read before Week 4 starts.
      • Chapter 8 and 9 are to be read before Week 5 starts.
      This reading schedule is for the 6th edition of the textbook. If you have another edition, please see me and I'll give you a comparable reading schedule.

      NOTE: Reading the book is NOT a passive experience!!! As the book suggests, you should be working with the examples on a computer as you read through the book!
  2. Homework 1: Assigned: Wednesday, 25 June. Due: Wednesday, 2 July.
    Now available, for your entertainment! This assignment is to get you used to working and designing solutions to problems. Anyone can write a program... you are here to learn how to design a good solution, and then implement it.
    Download: homework1.pdf.
  3. Homework 2: Assigned: Monday, 30 June. Due: Monday, 7 July.
    Inputting and evaluating polynomials. Polynomials are a common class of functions that are used virtually everywhere. In this homework, you are to design & implement a program that can read in a polynomial from the user and evaluate it at a specific value of x.
    Download: homework2.pdf.
  4. Homework 3: Assigned: Wednesday, 2 July. Due: Friday, 11 July.
    Writing your first menu driven program. Approximating weird mathematical constants like π and ex.
    Download: homework3.pdf.
  5. Homework 4: Assigned: Monday, 7 July. Due: Monday, 14 July.
    I hope everyone likes to play card games... anyone up for a game of blackjack?
    Download: homework4.pdf.
  6. Homework 5: Assigned: Friday, 11 July. Due: Friday, 18 July.
    Playing the exciting game of Guess that Number, and then getting the computer to play that game.
    Download: homework5.pdf.
  7. Homework 6: Assigned: Monday, 14 July. Due: Monday, 21 July. Worth 70 points!
    You are to create a library that handles common operations with polynomials. You may use either arrays or vectors for your representation, but you must pick one of the two API's defined in the addendum and conform to it strictly.
    Download: homework6.pdf, homework6.addendum.pdf.
    Array Driver: hw6-ArrayDriver.cpp.
    Vector Driver: hw6-VectorDriver.cpp.
    Driver Output: hw6-DriverOutput.txt. Note that this output is the same for both drivers (the array-based as well as the vector based).
  8. Homework 7: Assigned: Wednesday, 23 July. Due: Monday, 28 July. Worth 80 points!
    Simulating monkeys at typewriters... with style.
    Download: homework7.pdf,
    Input Files:
    1. Poe's Annabel Lee: poe-annabel-lee.txt (Sample output: one, two )
    2. Poe's The Raven: poe-the-raven.txt
    3. Poe's Tell-Tale Heart: poe-tell-tale-heart.txt
    4. Poe's Pit and Pendlulum: poe-pit-and-pendlulum.txt (Sample output: one, two )
    Frequency Calculator: Basic (html), Testing Example (html).
    Hints Document: click here.

Grading of the Course

As described in class, the grading for the course will be broken down as follows. I thought I'd post the exact grading scheme here also, as it may change as the course proceeds (this is usually because one or two homeworks/quizzes may be cancelled).
There are 1,000 points in the class, and the breakdown is as follows:
Attendance: 5% 50 points
Quizzes: 5% 50 points (with 5 quizzes, each is 1% -or- 10 points)
Midterm Exam: 15% 150 points
Final Exam: 20% 200 points
Lab Assignments: 20% 200 points (with 11 labs, each is 2% -or- 20 points)
Homeworks: 35% 350 points (first 7 homeworks are 4% -or- 40 points each
the last homework will be 7% -or- 70 points)

Total: 100% 1,000 points

Anonymous Feedback

If you have a question, suggestion, or comment about the class (or anything related to it), you may use the form at the link found below to send me a message anonymously.
Any anonymous feedback provided will be addressed during the next class period.
Please use this feedback seriously -- do not abuse it!

To send any anonymous feedback, Click Here.


Computer Science is no more about computers than astronomy is about telescopes.
-- E. W. Dijkstra
Of course, one must also remember...
A witty saying proves nothing.
-- Voltaire