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 2: Types and Expressions

Computer Programming II Java, unit 2 of 12

Unit 1 used four types on trust. This unit opens the whole type system: the eight primitive types, int against double, char and boolean, and what a reference variable actually holds. Arithmetic opens up with the full operator set, integer division, the remainder, compound assignment and final. Conversion is taught in three stages, what Java widens for you, what you must cast yourself, and the fact that a cast cuts rather than rounds.

The performance task is The Calculator That Is Honest About Money. The student computes a money result from values declared in the source, with a Type Table giving one row per variable saying why that type and not another, and two Failure Exhibits. Each exhibit shows the broken line, the wrong output copied from a real run, the fixed line and the right output, one for integer division and one for floating point rounding. A calculator that is correct by accident does not meet the standard.

The unit refuses to hand wave two things students will hit. Comparing two String values with == does something surprising, which is shown and then explicitly handed to Unit 3, and 0.1 plus 0.2 does not print 0.3, which is shown with the real output and answered with the two strategies this course allows, whole cents as int or deliberate rounding with Math.round. A teacher gets a plan and a substitute plan for each of the fifteen lessons, answer keys, tiered versions of the hardest handouts, and every document in editable Word and print ready PDF.

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
  • Handouts covering the eight primitive types, int against double, char and boolean, and what a reference holds
  • Integer division and remainder labs, with the wrong answer produced on purpose before it is fixed
  • Casting labs: widening, explicit casts, and the demonstration that a cast cuts rather than rounds
  • The floating point lesson, with the real printed output of 0.1 plus 0.2 and the two fixes the course allows
  • Mid-unit checkpoint with answer key, and answer keys for the graded handouts
  • The Calculator That Is Honest About Money task, the Type Table, the Failure Exhibit pages and the rubric
  • Vocabulary cards, a type and operator reference card, and sentence frames

Who it's for

  • Teachers whose students can write Java that compiles and now need it to be correct
  • Programs preparing students for the Certiport data types and operators objectives
  • AP Computer Science A teachers who want casting and integer division taught with evidence rather than assertion

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.