Unit III Talking Points—Boolean/Conditional Expresions

CS 1130 Visual Basic—Fall 2017

Day 08 (02/02)— Final Questions on Unit II; Unit III Introduction

Logistics

Ready for Unit II Competency Demo?

Are there any questions about the Unit II practice items or the sample competency demo? The competency demo will be next Tuesday, I hope.

Boolean Data & Operators—Conditional Expressions

I did not follow these notes during class but they should be helpful.

In past discussion we have mentioned the "types" of data. Mostly data is either numeric or string in type. But there is a third type that is also critical or required for programming. Boolean data allows us to ask questions about the data and to make decisions based on the answers to our questions. But, we can only ask yes or no questions. Questions that can be answered as true or false

We want to ask questions such as:

But we cannot ask the questions like that. We have to represent them in a way the computer can understand. We do that by constructing Boolean expressions.

As with the numeric and string expressions, Boolean expressions will make use of literals, variables, operators, properties, and functions. As a matter of fact the expressions we have already learned about will or can be part of a Boolean expression.

Boolean expressions produce a value of true or false. Often this is done by comparing two values, e.g., first greater than second, value #1 equal to value #2, age less than 21, etc. Sometimes we want to examine several conditions, e.g., height greater than 48 inches and weight greater than 60 pounds. There are operators that allow us to do that also.

We construct Boolean using:   literals,   variables,   property values,   numeric and string (data) operators (+ - * / ^ Mod &),   relational operators (< <= >= > = <>),   logical operators (And Or Not),   and parentheses. You also need to be thinking about how to evaluate the expression — how the computer will "calculate" the result. Questions/Comments?

When evaluating Boolean expressions do the data expression values first, then the relational, then the logical. The precedence/order of operations is:

Some Examples

Next Time

Day 09 (02/07)— Unit II Comp.Demo;  Unit III Work

Logistics

Unit II Competency Demo Questions

Are there any questions about the Unit II practice items or the sample competency demo? (The competency demo will take the latter part of the class?)

Unit III Practice Activity Questions

Review any items students want to review. Otherwise, work as time allows.

Unit II Competency Demonstration

(At about 4:10) Separate students, distribute the CD, remind students that goal is to demonstrate competency with VB, not understanding my items. If there is any doubt about what is desired, ask!

Next Time

Day 10 (02/09)— Unit II CD.a Review;  Unit III Finalization

Logistics

  • Roll
  • Questions? Wonderings? Comments?

Review Solution to CD-II.a

Display instruction solution and respond to questions.

Ready for Unit III Competency Demo?

Are there any questions about the Unit III practice items or the sample competency demo? The competency demo will be next Tuesday, I hope.

Project Discussion?

?

Next Time

  • Unit IV intro or work; CD-III.a

Day 11 (02/14)— Unit IV Introduction?

Logistics

  • Roll
  • Questions? Wonderings? Comments?

Unit III Competency Demonstration

(At about 4:10) Separate students, distribute the CD, remind students that goal is to demonstrate competency with VB, not understanding my items. If there is any doubt about what is desired, ask!

Unit IV Introduction?

?

Next Time

  • Unit IV intro or work; CD-III.a