Hello Computer Science: C++ Boolean Expressions

Prepare today for the demands of tomorrow.

hello-world.com
Privacy
Policy

Site map

Hello-World

At the end of this lesson you will know what Boolean expressions are and how to use them in a program.
You will be able to write a program uses Boolean expressions to determine the sequence of actions.

1. Print and read the lesson. (Punch, staple, put in your binder.) Boolean Expressions

2. Do the "Rats in the maze" problems.

3. Run each of the programs from the lesson:

Test IF: asks user for a number, prints whether the number is true or false. Flowchart
Input two numbers print out in order. Flowchart
Input two numbers, exchange so that num1 <= num2. Flowchart
Letter grade: inputs numerical grade, print letter grade. Flowchart
Letter grade2: inputs numerical grade, print letter grade, uses a char variable. Flowchart
Valid Month: uses enters a number, it is valid if it is between 1 and 12.
Valid Month2: uses enters a number, it is invalid if it is not between 1 and 12.
Rat in the maze: Ask if doors are open, tells if the rat escapes
Seasons: inputs a month, prints the season or invalid message
Simple Calculator: lets the user input a simple expression such as 3+4, prints the result
Nonsense program to illustrate break
Speedy or Reliable: Decides which shipper has the best price

To get the most out of these programs

4. Using the sample programs as a model, write a program that will input three numbers and print statistics.
Follow good programming habits:


Copyright © Hello World Publications. All rights reserved worldwide.

hello-world.com
Privacy
Policy

Site map

Hello-World