Week 2 — Expressions, Operators & Types
Apr 7 – Apr 11 · 5 lessons · Quiz 2 (Thu) · Labs 03–05
- Mon · 2-a Scanner, Conversion & Scope nextLine, parseInt, parseDouble
- Tue · 2-b Arithmetic & Precedence *, /, % before + −; type promotion
- Wed · 2-c Compound Assignment & Increment +=, -=, ++, --; accumulator pattern
- Thu · 2-d Boolean Expressions & Branching &&, ||, !, if/else/else-if chains
- Fri · 2-e Type Casting & Floating-Point (double) cast, 0.1+0.2≠0.3, printf
Objectives
- Read all input types safely with Scanner
- Apply operator precedence rules
- Use +=, -=, ++, -- correctly
- Write boolean expressions with &&, ||, !
- Force decimal division with (double) cast
This Week
- Quiz 2
- Thursday in class — expressions, operators, types
- Lab 03
- User Input — Scanner methods, mixed types, nextInt/nextLine trap
- Lab 04
- Paycheck Calculator — Scanner + arithmetic + compound assignment
- Lab 05
- Score Analyzer — boolean expressions + branching + casting
Reading & Practice
- Ch. 2 §2.1–2.2 — Data Concepts, Variables & Arithmetic
- Ch. 4 §4.1 — if/else Statements
- Ch. 5 §5.3 — The boolean Type
- Code Step by Step — Week 2 Practice