Unit 10: Post-AP Exam Projects (4–5 weeks)

Lesson 4.04: Reference Semantics


Objectives — Students will be able to…

  • Compare and contrast how primitives and arrays are treated when passed as parameters.

Assessments — Students will…

  • Complete graphic organizers and a worksheet

  • Extra credit: complete a Pokémon Challenge

Homework — Students will…

  • Read BJP 7.3 and 7.4 up to “Command-Line Arguments”

  • Complete exercises #9, 10

Materials & Prep

The “worksheet” for today is a 5-page work packet, so if your school has long lines/production time for the copy machine, plan ahead!

Pacing Guide


Total Time

Bell-work and attendance


Student activity


Student trade & check


Whole group review & paper submission



Hook your class today with the concept of a “backwards” class structure. Using only the information gleaned from last night’s reading (and perhaps some help from a friend), students should work through as much of the worksheet as they can in the time allotted (~30 minutes). Finish the class with whole-class note taking on the topics that were challenging in the sheet.

Bell-work and Attendance [5 minutes]

Student Activity [25-30 minutes]

Have students start working on WS 4.4 in pairs or alone. Use a timer to help students pace themselves.

Students Trade & Check [5 minutes]

After 25–30 minutes give students a few minutes to check each others’ work.

Whole Group Review & Paper Submission

  1. As a whole group, ask students for questions they had on the worksheet. Use the answer key included on this to guide instruction.

  2. Collect worksheets at the end of class.

Accommodation and Differentiation

If you have been using Parson Problems throughout the year, your students will be familiar with the format of Question 8 on the worksheet. For other classes, this may be the first time they’ve been asked to rearrange provided code. Read through the problem out loud with the class, then read through the lines of code in the bottom half of the question. Each line of code (even the lone bracket) can be shuffled and re-arranged to provide the correct code sequence.

Student success in this lesson relies heavily on students’ having been able to read and comprehend the prior nights’ reading. In ELL classrooms, encourage students to open their books and work with the text in front of them, and pair students of differing language abilities.

  • If you know your students’ reading abilities will not allow for a lesson like this, conduct the lesson as a whole-group, teaching a segment of the chapter and pausing to let students work on a question before moving forward.

  • The worksheet matches up sequentially with section 7.3, so you can have students read along with your in the book as you work through the sheet, and/or you can allow advanced students to work on their own as you help the rest of class.

There will probably be a lot of variation in how long it takes students to complete today’s assignment.

  • Ask students who finish early to design a hands-on demonstration that uses the array whiteboards (and any other materials around the room) to explain the proper answers to the questions on the worksheet. If they come up with any cool demos, use them during student review at the end of the class.

  • Be ready with a Pokemon Challenge for the students that speed through the assignment:


This java based calculator (http://www.legendarypokemon.net/javacalc.html) uses median IVs (initial values) and input EVs (effort values) to calculate a Pokemon’s stats on a given level.

Write a method called medianIV that accepts an array of integer IVs as its parameter and returns the median of the numbers in the array.

The median number is the number that appears in the middle of the list if you arrange the elements in order. You can assume that the array is of odd size (so that one element is found in the middle), and that the numbers in the array are between 0 and 99, inclusive. For example, the median of [5, 9, 4, 10, 11] is 9, and the median of [0, 8, 1, 89, 48, 27, 30] is 27.

Hint: Check out the Tally program in chapter 7 for some ideas on what code to use.

Final Project

The Java based calculator that uses median IVs and input EVs to calculate a Pokemon's stats on a given level provides you with an in depth look of how complex some calculations can get in these types of games. As you continue to think about your final project in the course, consider how you will use calculations to determine a characters health or attack values.


Forum discussion

Lesson 4.04 Reference Semantics (TEALS Discourse account required)