Creating Records
Overview
In this lesson, students will create a new refernce type by creating a record.
Learning Objectives
- 1.1.B.6 Distinguish between mutable and immutable data types.
- 1.1.B.7 Create new data types for immutable data using records.
- 1.1.B.8 Create instances of records.
Skills
- S1.B Explain the impact design has on security.
- S1.C Explain the impact design has on data storage.
- S2.A Write program code and implement algorithms.
- S2.C Analyze an algorithm and program code for correctness.
Student Outcomes
Students will be able to:
- recognize when data would need to change during the running of a program.
- recognize when data should not change during the running of a program.
- create a new type by creating a record.
- create an object of a record type.
Duration: 2 class periods
Resources
Learn
Either as a group or on their own, have students review tutorial: Learn: Introduction to Records
Debrief: If completed independently, reserve time to conduct a debrief with students to ensure they do not have any questions.
Practice
Wrap-up / Extension
Ask students to brainstorm other immutable data that could be represented using a new record.
Next Lesson
Lesson Plan: Introduction to Arithmetic Expressions