Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Parts are independent

โญโญโญ advancedโณ 10 min read๐Ÿ“ Lesson 206 of 256

Part (b) never needs part (a); graders score each separately โ€” a botched part must not cascade.

The weather-station archetype (this module's workshop problem): one array of readings, three behaviors. It exercises every FRQ-Q1 muscle:

  • Count with a condition (below freezing): one accumulator, one comparison. The trap is < vs <= against 0.0 โ€” the spec's word "below" means strict.
  • Longest streak (warm run): the run-counter pattern with a reset. Two state variables (current run, best run) and the reset branch are the whole problem.
  • Parallel-array average: walk indexes (not for-each) because two arrays advance together; guard the nothing-matched case so it returns 0.0 instead of NaN.

Notice each part reuses a pattern from modules 4โ€“7. The FRQ is not new material โ€” it is your existing patterns under one story, with the story trying to confuse you about which pattern applies.

โšก Now practice

Ready to Code
FRQ workshop: the weather stationThree parts of one FRQ, graded independently โ€” plan first, then implement.
3 challenges ยท ยท ~55 min