Common programming bug in decision statement!

Suppose you have a variable called Feedback and you want to find out if the value is 1 or 2.  Does the following work?

Feedback = 1 OR 2

No, it first evaluates the righthand side of the expression “1 OR 2” as True.  Actually 1 is True so “1 OR anything” will be true.  I know that’s not what you wanted.  What you wanted was

(Feedback =1) OR (Feedback = 2)

which produces the correct, expected result.  Caveat emptor

Corrected class schedule

Khaled Mansour has updated the reading list.  Sorry my version I handed out on week #1 was not very good.  Please toss your week #1 schedule (except don’t forget the MidTerm exam date!!).  Thanks.

Here are the chapters corresponding to each week: Please adjust accordingly
1 Introduction, Algorithm Design, I/O, Process [chapter 1 , Input, process and output]
2 Binary Numbers, Boolean Logic and Gates – [chapter 4 , Binary numbers]
3 Making Decisions (Visual Logic) – [chapter 2 , Making decisions]
4 While Loops (Visual Logic) – [chapter 3, While loops]
5 Memory Management – [chapter 5, memory management]
6 Process Management – [chapter 6, Process management]
7 Relational Database, Arrays (Visual Logic) – [capter 7, Relational Model]
8 Internet, html, WWW, Network – [chapter 8, Computer network]
9 Algorithms (Visual Logic) – Visual Logic
10 Functions (Visual Logic) – Visual Logic
11 Introduction to C++ – [Chapter 9, 10, 11, Writing C++]
12 Variables, Types, if statement in C++ – [Chapter 12, 13, Types]
13 Arrays and for loop in C++ – [Chapter 14, Arrays]

Homework #3 sample output

Your output should look SOMETHING like this…..  Be sure to give me screenshots.   In this example, the human being (ME!) guessed “89” and my job is to coax the computer to the right answer.  Don’t lie to the computer or the program won’t work.
Think of a Number...!
Guess #1: I guessed 50
Am I...? 1=Low, 2=High, 3=Correct ? 1
Guess #2: I guessed 75
Am I...? 1=Low, 2=High, 3=Correct ? 1
Guess #3: I guessed 88
Am I...? 1=Low, 2=High, 3=Correct ? 1
Guess #4: I guessed 94
Am I...? 1=Low, 2=High, 3=Correct ? 2
Guess #5: I guessed 91
Am I...? 1=Low, 2=High, 3=Correct ? 2
Guess #6: I guessed 90
Am I...? 1=Low, 2=High, 3=Correct ? 2
Guess #7: I guessed 89
Am I...? 1=Low, 2=High, 3=Correct ? 3
Took me 7 Guesses! Aren't I a smart computer???

Week #3: Homework, PowerPoint, Lab

Week #3 objectives:

  1. Understand the IF statement and looping in VisualLogic
  2. Describe the machine cycle used to process data in the computer.
  3. Explain the use of stored programs and compilers and interpreters.
  4. Describe the development of programs and the use of high level languages.

Week #3 Materials

Clarification on VisualLogic availability in the labs

We apparently do not yet have a site license for Visual Logic. –

This shouldn’t be a problem, however, as I understand that Visual Logic runs fine off of the Visual Logic CD’s that come with the book bundle students purchased. The publisher is tracking down the author of VL to find out about getting a site license so that we may install and run VL from the hard drive of computer lab workstations. This may take a while, so please plan on having everyone bring their CD’s to each class….

Neil Gudsen
BOS and CIS Program Manager
Washtenaw Community College
4800 East Huron River Drive
Ann Arbor, MI 48105-4800

(734) 677-5296