Week 2: Boolean Expressions and Conditionals

Learning objectives:

Upon finishing this learning module, you should be able to:
  • Use relational operators to construct simple boolean statements
  • Write a program using conditional expressions

Deadlines This Week:

  • Monday 11:59PM - Assignment 1
  • Thurs 11:59PM - CppLab Conditionals 1 (see below)
  • Sat 11:59PM - CppLab Conditionals 2

Classroom Schedule:

Monday
  • Type Conversions, other Operators
  • Read 2.7 and 2.11-2.16
  • Do MentalCodeOpsCasts WS
Tuesday
  • Booleans and If
  • Read Ch 3.1-3.4
  • CppLab conditionals 1
Wed
  • Nested Ifs
  • Conditional Operators
  • Read Ch 3.5-3.8
  • CppLab conditionals 2
Fri
  • Boolean Operations/Switch
  • Do BooleanPractice WS
  • Read Ch 3.10-3.11, 3.13-3.16

Online Activity Outline:

If you haven't already, make sure you submit Assignment 1. It is due Monday at midnight.

Data Conversions

  • Read 2.7 and 2.11-2.16. Do the MentalCodeOpsCasts worksheet (see Classroom files link). Like last week, try doing in your head, then check it using the debugger.
  • Finish reading Ch 2. Ch 2.14 and 2.15 have some sample programs. As you read them, focus on the problem solving process described. If you were writing one of these programs yourself, you should do the same thing, but then write the code a few lines at a time and test them as you go (printing things out or with the debugger).
    Ch 2.16 has some quick tips on common mistakes - learning from other people's mistakes is a lot less painful than learning from your own!

Conditionals

  • Read Ch 2.11-2.13. Do the MentalCodeOpsCasts worksheet (see Classroom files link). Like last week, try doing in your head, then check it using the debugger.
  • Finish reading 2.15-2.16.
  • Read Ch 3.1-3.4. This video introduces some of the key concepts:
  • Do Conditionals 1 CPPLab. There is a link to CPPLab at the top of this page. Your username is the same as your Chemeketa username. Initial password is "changeme" without quotes. You can change it on the login screen. CPPLab is designed to give you the practice you need to really learn how to program. Some of the problems are easy, some are hard. Each assignment is scored on a generous curve - you should make sure to do some work on each one but not panic if every now and then you get stuck.
    CPPLab Intro Video
  • Read powerpoint on Scope from the Classroom/sides examples. It covers some useful background material that the book does not mention until later. This video walks through some demonstrations of how scope affects variables:
  • Read Ch 3.5-3.8. This video introduces some of the ideas:

  • Do Conditionals 2 CPPLab.
  • This video demonstrates using the debugger to trace your way through the computer tax example:
  • Read Ch 3.10-11 and 3.13-16.
    Note: you do not need these parts of Chapter 3 to do the assignment or CPPLabs. Next week involves less material, if necessary you can worry about mastering these section next week.
    These videos cover the basics of those sections:

  • Do the Boolean Practice worksheet (see Classroom slides/examples link below for WS and key).
  • Do the assignment.

Extra Info:

Learncpp.com

This online tutorial covers some of the same ground as the Liang readings use it as a supplement if you need one:
LearnCpp.com chapters 2.8, 3.3, 4.4, 2.6, 5.1-5.2

Classroom slides/examples:

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

Assignment:

Assignment #2