AP CS A Unit 2

Unit 2, Day 4

Mr. Jones | AP Computer Science A

Warmup

Come on in - sit anywhere you like

Warmup: Write a java if statement that replicates this sentence:

“If it’s sunny, OR if the temperature is greater than 80 and it’s not raining, I will go to the beach.”

Assume these variables already exist:

  • boolean sunny
  • int temperature
  • boolean raining

Announcements

Upcoming Schedule

  • Pep Rally this Friday - no WP

Congrats to Micah - Boolean Girl Program

Sisters Rise Up

Girls in Tech

Amazon Future Engineer

Brain Scans end early next week

Guest Speaker - Monday during A lunch

Mastercard, BRGs, and Hispanic Heritage Month

Strategy Consulting - Gathering Information From Data

Upcoming Schedule

Upcoming Schedule

  • Today:
    • Practice compound boolean statements
  • Monday:
    • A bit more loops/conditionals
    • introduce project
  • Wednesday:
    • Test review
    • Continue project
  • Friday:
    • Test
  • Thursday, Nov 2:
    • Quarter Exam

Order of Operations with Boolean

PEMDAS, but with boolean operations

  • ! > && > ||
  • Practice: Add parenthesis to these statements that preserve the meaning but improve readability

Practice 1: A || B && C

Practice 2: A && B || C

Practice 3: A && B && C || D

Practice 4: !A && B || D

Simplifying Boolean Expressions

Today - Branching

Branching

Recap Unit 2, Day 4

This is a recap slide

(To be completed)

More recap

(Coming soon)