CS141: Topics for Week 5: Feb 12/14/16, 2018


Computer Science Headlines: ACM Tech News

Reading:

Lab and Other Activities

Lecture Discussion Topics:

Concepts and Vocabulary

Types of Decision Structures:
  ... if statement
  ... if-else statement
  ... multi-way if-else
  ... nested if-else
  ... switch statements
  ... indentation conventions
Code blocks & variable scope


Decision Structure Syntax:
  ... decision logic and flow charts
  ... condition and body
  ... boolean value, expression

Random numbers


Building Boolean Expressions:
  ... relational operator (<, >, <=, >=, ==, !=)
  ... boolean (logical) operators (!, &&, ||). Examples
  ... boolean operators precedence (See table)
  ... truth tables (p. 209)
  ... De Morgan's Laws (p. 212)

String Comparison
  ... Lexicographic ordering (of Strings)
  ... compareTo() and .equals operators

Other (optional)
  ... The Conditional Operator bool ? val1 : val2 (p. 182)
  ... Switch statement (p. 195)