Week 1: Class Overview and Introduction to Object Oriented Programming (OOP)

Learning objectives:

  • Design classes to represent data types in C++
  • Construct and read UML class diagrams
  • Write basic object oriented programs using common design principles

Deadlines This Week:

  • Wed 11:59PM - Background Survey and Class Policies Review in eLearn. The review is scored as an assignment. The survey is not graded, but if you do not complete it you will be given a 0 on the Class Policies Review.
  • Thurs 11:59PM - Object Basics - Use CPPLab
  • Fri 11:59PM - Object Basics - Creation CPPLab
  • Next Monday 11:59PM - Assignment 1

Classroom Recaps:

Monday
  • Review Syllabus and Course Tips
  • OOP Intro
  • Read Ch 9.1-9.3
  • Setup Qt Creator at home if you haven't
  • Take the background survey in elearn
Tuesday
  • Constructors and Access Modifiers
  • Read Ch 9.4-9.5, and 9.9
  • CPPLab - Objects Basics - Use
Wednesday
  • Headers, Comments and UML
  • Read Ch 9.6-9.7, 9.10-9.11
  • CPPLab - Objects Basics - Creation
Friday

Online Activity Outline:

Setup

  • Review Syllabus and Course Tips (find them in the Documents link at the top of the page). Then do the Background survey and Class Policies Review activity in eLearn.
  • You took CS161 at Chemeketa: download a new copy of the QtProject folder from the Resources link at the top of the page. Delete your existing one and use the new version. I have updated the Unit Test template since fall term.
  • If you did not take 161 at Chemeketa, you need to become familiar with how I have things set up and how to setup QtCreator:
    • Click on the CS161 Tab at the top of the page. Go to Week 1 on that page (links to weeks in top right corner of page).
    • Watch the welcome to CS161 video. The course is set up much like 161, that first video will show you where to find things.
    • Watch the first row of videos below that one on using QtCreator and working with projects. Most of the time you will be submitting just code files, but there will be times where you submit a QtProject - you should get used to working with it. (If you do try using something else, be aware that all code must compile using gcc on a windows box using the flags -std=c++11 -pedantic-errors. Code that does not compile because you used a different compiler/settings and did not check for compatibility will be penalized heavily).
    • If you took CS161 in Java (or did AP CS A), you need to learn the basics of C++. Check the C++ Crash Course for Java Programmers link in the C++ Reference section of the menu at the top of the page. Read through it and remember to consult it for reference when you need to figure out how to do something in C++.

OOP Basics

  • The history of modern programming is a quest for abstractions and structure that can be added to assembly code to make programmers more productive and less error prone. At some point, our code gets boiled down to machine instructions we could have written directly in assembly... but higher level languages allow us to more succinctly express ourselves and provide structure and limitations that prevent us from writing unintelligible and unmaintainable code.
    Object Oriented Programming is a methodology for structuring programs that aims to make parts of a system accessible to each other through high level abstractions - so you don't have to know the ugly details of how a window paints itself to the screen, just that you can ask it to repaint itself by saying window.repaint(). It is the methodology of choice for most large projects involving large teams of developers all working on different parts of a system. There is nothing we can write using OOP we could not write without it, but it does make some jobs much easier.
  • Read Ch 9.1-9.5 and watch these videos:
    OOP Basics
    Constructors
  • Do CPPLab - Objects Basics - Use
    Link to CPPLab can be found in the navigation bar at the top of the page.
    If you are not familiar with CPPLab, watch the video below. We will use it to get some of the small scale practice required to really understand what you are doing. Your username is the same as your my.chemeketa gmail username. Your starting password is "changeme" - you can change it on the login screen.
    CPPLab Intro Video

Encapsulation, Headers and Information Hiding

  • Read Ch 9.6-9.7 and watch these videos:
    Encapsulation
    Header Files
  • Do CPPLab - Objects Basics - Creation

Documentation and UML

  • Read 9.10-9.11 and watch these videos:
    Documentation
    WTH is UML?
  • Complete this week's assignment - start early so that you have time to get assistance if you need it!

Source Control:

Source control is going to take you a while to master - don't worry about doing it all this week. Watch the videos and at least work through part 1 of this Git Tutorial.
These videos introduce the basic idea behind source control and a very brief intro to using it.
Source Control Intro - what git is
Source Control Details - how we will use git

Related Links:

Extra Info:

OOP Introduction

New to object oriented programming? Having trouble seperating the details from the big picture? Try reading through this overview:
Don't fear the OOP

Learncpp.com

This online tutorial covers some of the same ground as the Liang readings:
LearnCpp.com chapters 8.1-8.5 and 8.9

Assignment:

Assignment #1

Classroom slides/examples:

Directory of classroom files from the week
Right click files and save to your computer