Week 1 - Introduction to C++ Programming
Learning Objectives
Upon finishing this learning module, you should be able to:
- Describe how a C++ program goes from source code to working program
- Identify the functions of basic components of a C++ program
- Use assignment and use the basic math operators
Curriculum Update Note
CS161 is getting a curriculum update this term. We are moving to a new interactive textbook and are updating some of the topics and tools we use in the course.
My goal is to publish the material for the coming week by Thursday of the current week. (Week 2 material should be available by Thursday of week 1.) However, there may be parts of the material that are not quite ready at that time. If so, there will be a note indicating what is still pending.
Some of the videos may feature slightly different tools or examples than what you are using and see in the book. Anything that is substantially changed I am rerecording, but there will be some videos that don't look exactly like what you will see as you do your work. So don't panic if something you see in a video is not exactly what you see in your tools or book.
Because this is a new curriculum, I expect there will be some rough spots that need to be smoothed out. If you find something that is confusing or doesn't work, please let me know so I can fix it for future students.
Recommended Schedule
You have a lot of freedom to choose when you get the work done each week.
There is a recommended schedule below to help you break up the work into manageable chunks. Trying to do all of your learning in one monster day of studying tends to be much less effective than working on smaller chunks of the material more often.
Although the major assignments are always due at the start of next week, there are often mid-week deadlines for other work (check Canvas for all due dates), so you can't wait until the weekend to get everything done.
If your schedule requires you to do most of your work for this class on the weekend, you should try to work ahead on the next week each weekend rather than playing catchup from the previous week. That way you have plenty of time to ask questions and get any needed help before your assignments are due.
Day 1
- Course Intro and Survey
- Access Book
- Start C++ & Development Basics (Ch 2.1-2.4)
Day 2
- Complete C++ & Development Basics (Ch 2.5-2.11)
- Do Ch2 exercises
- Set up a codespace
Day 3
- Variables and Operators (Ch 3.1-3.12)
- Work on Ch 3 exercises
Day 4
- Development Intro (Ch 3.13-3.15)
- Do assignment 1
Course Intro
In Canvas, watch the welcome video, review the syllabus and fill out the background surveys.
Access Book
Watch this video to see how to use the book and complete the book based assignments.
Not all assignments will be completed in the book. Canvas (Elearn) should be your primary source for assignments and due dates.
C++ & Development Basics
Work through Ch2.1-2.10.
This video talks through the Hello World example on 2.4 and demonstrates using the ActiveCode widget in the book:
Set Up a Codespace
To start with, we will be using GitHub Codespaces as our development environment. Eventually, you will learn how to set up a C++ development environment on your own computer, but Codespaces provide a simple way to get started programming in C++. They also have the advantage of allowing you to access your work from any computer with a web browser.
See the Codespaces guide for instructions on how to set up and use a Codespace.
I recommend setting up a Codespace that you use for testing. Any time you just want to test out a code sample or do an experiment, use your test Codespace. By reusing that same Codespace, you avoid having to spin up a new Codespace each time you want to test something.
When you are working on an assignment you will submit, create a separate Codespace for that assignment.
Using VS Code
Whether you are using a Codespace or, later on, a local installation, we will be using VS Code as our primary programming environment. This video introduces how to use it to write and run code:
Variables and Operators
Work through Ch 3.1-12.
The Debugger
The debugger is a CRITICAL tool for learning programming. This video shows how to use the debugger in a Codespace.
Development Intro
Read Ch 3.13-3.15.
Do Assignment 1
Start working on the first submitted assignment. It is listed as "Assignment 1" in Canvas.
Most weeks will include an assignment you will complete outside of the book and submit in Canvas. As part of starting the first assignment, you should make sure to read this document about the work history you must submit as part of every assignment.
There is a video in that document that shows how your work history is documented and how to inspect that history.
When you are complete, here is how to submit your assignment: