The School Design Group Tools for people who build schoolsand the teachers who bring them to life

← All toolkits

Part of Computer Programming I

Unit 4: Decisions and Loops in Java

Computer Programming II Java, unit 4 of 12

Unit 3 could ask whether an answer made sense and could do nothing about it, and every program so far asked its questions once and stopped. This unit finishes both. Selection arrives with parentheses and braces, conditions that are genuinely boolean, else if in two words, comparing text correctly, and the and, or and not operators. Switch is taught as the menu case. Repetition arrives as while, then the three part for header, then counting, totalling and asking again, then loops inside loops that draw a grid or a shape.

The performance task is The Pattern Engine. The student's nested loops must reproduce a printed target character for character, proven by a line by line check with a same or different mark on every line, plus a trace table covering the first three passes of the outer loop and three boundary runs at size one, a typical size and the largest size that still fits the screen. The task states in those words, before the student starts, that a program with elegant loops whose output is nearly right does not meet the standard.

Two limitations are named to students rather than hidden. A loop that computes ten results can print all ten and keep only the last one, which Unit 7 pays with arrays, and the running total is presented as the workaround it is. The pattern engine has to regenerate its output every run because there is nowhere to store it, and files are Unit 11. A teacher gets a plan and a substitute plan for each of the fifteen lessons, answer keys, tiered handouts, and grid paper style targets that can be checked by counting spaces.

The unit runs 15 instructional days.

What's inside

  • A teach plan for each of the 15 lessons, plus a one page substitute plan per lesson
  • Selection labs: if with braces, boolean conditions, else if, comparing text correctly, and and, or and not
  • A switch lesson taught as the case where a list of tests is really a menu
  • Loop labs: while, the three part for header, counters, running totals, and asking again until the input is valid
  • Nested loop labs that produce a table and a shape, printed on paper where spaces can be counted
  • Mid-unit checkpoint with answer key, and answer keys for the graded handouts
  • The Pattern Engine task with the printed target, the line by line difference check, the trace table and the boundary test
  • Vocabulary cards, a condition and loop reference card, and sentence frames

Who it's for

  • Teachers who want control flow assessed by exact output rather than by looking about right
  • Programs preparing students for the Certiport flow control and loops objectives, the heaviest pair on the exam
  • AP Computer Science A teachers who need nested loop tracing done on paper

License, plainly

Adapt it, rename it, put it on your letterhead, use it as your own. The single license covers one classroom or one organization; the school license covers everyone in the building or department. Do not resell it or publish it as a template product. Full terms.

Also useful

Course

Computer Programming II: Java

Twelve units, 180 days, twelve performance tasks, a lesson plan and a substitute plan for every lesson, aimed at Certiport IT Specialist Java.

Course

Computer Programming I

Twelve units, 180 days, 665 documents. Binary to capstone, with a portfolio and interview practice at the end.