Description
AP Computer Science A
Unit 4: Data Collections
Lesson 6: Using Text Files
Full Lesson Plan, Guided Notes, Slides & Homework
In this lesson, students will learn how to read data from external text files using Java’s File and Scanner classes. They will understand how to handle file input, tokenize data, manage file-related exceptions, and practice organizing and analyzing data using file reading techniques.
What’s Included:
- Detailed lesson plan
- Student guided notes
- Editable PowerPoint presentation
- Instructional video of the lesson
- Check for Understanding (CFU) with answer key
- "Unplugged" homework assignment to reinforce learning
Student Learning Objectives:
- I can use the File and Scanner classes to read data from a text file in Java.
- I can identify and use the correct Scanner methods to read different types of data (int, double, String).
- I can handle file-related exceptions using throws IOException.
- I can use loops to process all the data in a file efficiently.
Standards Alignment (AP CSA 2025 Framework):
- 4.6.A - Develop code to read data from a text file.
Perfect For:
- New or experienced AP Computer Science A teachers
- Teachers introducing Java syntax and programming structure
- Schools using College Board’s official AP CSA framework
This resource is classroom-tested, student-friendly, and fully aligned to AP CSA expectations. Whether you're teaching this topic for the first time or want a polished, print-and-go lesson, this resource has you covered.
Interested in more of Goldie's Materials?
Goldie's FULL CURRICULUM for AP Computer Science A
Goldie's Complete Unit Curricula:
Unit 1 – Using Objects and Methods
Unit 2 – Selection and Iteration
Goldie's Assessments:
Unit 1 – Using Objects and Methods | Goldie's Assessments
Unit 2 – Selection and Iteration | Goldie's Assessments
Unit 3 – Class Creation | Goldie's Assessments
Unit 4 – Data Collection | Goldie's Assessments
Goldie's Coding Projects & Activities:
Unit 1 – Using Objects and Methods | Goldie's Projects & Activities
Unit 2 – Selection and Iteration | Goldie's Projects & Activities
Unit 3 – Class Creation | Goldie's Projects & Activities
Unit 4 – Data Collection | Goldie's Projects & Activities
*******************************************************************
Unit 1 Individual Lessons:
- Lesson 1 – Welcome to Java
- Lesson 2 – Variables and Data Types
- Lesson 3 – Expressions and Output
- Lesson 4 – Casting and Range of Variables
- Lesson 5 – Creating and Storing Objects
- Lesson 6 – Creating and Calling an Object's Methods
- Lesson 7 – String Manipulation
- Lesson 8 – Math Class
Unit 2 Individual Lessons:
- Lesson 1 – Conditional Statements
- Lesson 2 – Nested Selection
- Lesson 3 – Compound Boolean Expressions
- Lesson 4 – while Loops
- Lesson 5 – Implementing Selection and Iteration Algorithms
- Lesson 6 – for Loops
- Lesson 7 – Implementing String Algorithms
- Lesson 8 – Nested Iterations
Unit 3 Individual Lessons:
- Lesson 1 – Impacts of Program Design
- Lesson 2 – Program Design
- Lesson 3 – Classes and Constructors
- Lesson 4 – Accessor and Mutator Methods
- Lesson 5 – Class Variables and Methods
- Lesson 6 – References, Scope, and this
Unit 4 Individual Lessons:
- Lesson 1 – Ethical and Social Issues Around Data Collection
- Lesson 2 – Data Sets
- Lesson 3 – One Dimensional Arrays
- Lesson 4 – Array Traversals
- Lesson 5 – Implementing Array Algorithms
- Lesson 6 – Using Text Files
- Lesson 7 – Wrapper Classes
- Lesson 8 – ArrayList
- Lesson 9 – ArrayList Traversals
- Lesson 10 – Implementing ArrayList Algorithms
- Lesson 11 – 2D Arrays
- Lesson 12 – 2D Array Traversals
- Lesson 13 – Implementing 2D Array Algorithms
- Lesson 14 – Searching Algorithms
- Lesson 15 – Sorting Algorithms
- Lesson 16 – Recursion
- Lesson 17 – Tracing Recursive Output
- Lesson 18 – Recursive Searching and Sorting
If you need extra explanations or additional guidance, I would love to help!!
AP® is a trademark registered by the College Board, which is not affiliated with, and does not endorse, this product.
I want to provide the best possible resources to help other teachers out! You will be notified of any future updates and additions to this product and it will be free of charge. Your support is essential and I thank you for allowing me to continue doing what I love to do.
© Goldie’s Math Emporium, LLC
This work is bound by copyright laws and editing (beyond your own classroom use), selling, redistributing, or posting all or part of these documents on the Internet is strictly prohibited. Violations are subject to the Digital Millennium Copyright Act.
Using Text Files - Unit 4 Lesson 6 | Goldie's AP® CSA Curriculum
Highlights
Save even more with bundles
Description
AP Computer Science A
Unit 4: Data Collections
Lesson 6: Using Text Files
Full Lesson Plan, Guided Notes, Slides & Homework
In this lesson, students will learn how to read data from external text files using Java’s File and Scanner classes. They will understand how to handle file input, tokenize data, manage file-related exceptions, and practice organizing and analyzing data using file reading techniques.
What’s Included:
- Detailed lesson plan
- Student guided notes
- Editable PowerPoint presentation
- Instructional video of the lesson
- Check for Understanding (CFU) with answer key
- "Unplugged" homework assignment to reinforce learning
Student Learning Objectives:
- I can use the File and Scanner classes to read data from a text file in Java.
- I can identify and use the correct Scanner methods to read different types of data (int, double, String).
- I can handle file-related exceptions using throws IOException.
- I can use loops to process all the data in a file efficiently.
Standards Alignment (AP CSA 2025 Framework):
- 4.6.A - Develop code to read data from a text file.
Perfect For:
- New or experienced AP Computer Science A teachers
- Teachers introducing Java syntax and programming structure
- Schools using College Board’s official AP CSA framework
This resource is classroom-tested, student-friendly, and fully aligned to AP CSA expectations. Whether you're teaching this topic for the first time or want a polished, print-and-go lesson, this resource has you covered.
Interested in more of Goldie's Materials?
Goldie's FULL CURRICULUM for AP Computer Science A
Goldie's Complete Unit Curricula:
Unit 1 – Using Objects and Methods
Unit 2 – Selection and Iteration
Goldie's Assessments:
Unit 1 – Using Objects and Methods | Goldie's Assessments
Unit 2 – Selection and Iteration | Goldie's Assessments
Unit 3 – Class Creation | Goldie's Assessments
Unit 4 – Data Collection | Goldie's Assessments
Goldie's Coding Projects & Activities:
Unit 1 – Using Objects and Methods | Goldie's Projects & Activities
Unit 2 – Selection and Iteration | Goldie's Projects & Activities
Unit 3 – Class Creation | Goldie's Projects & Activities
Unit 4 – Data Collection | Goldie's Projects & Activities
*******************************************************************
Unit 1 Individual Lessons:
- Lesson 1 – Welcome to Java
- Lesson 2 – Variables and Data Types
- Lesson 3 – Expressions and Output
- Lesson 4 – Casting and Range of Variables
- Lesson 5 – Creating and Storing Objects
- Lesson 6 – Creating and Calling an Object's Methods
- Lesson 7 – String Manipulation
- Lesson 8 – Math Class
Unit 2 Individual Lessons:
- Lesson 1 – Conditional Statements
- Lesson 2 – Nested Selection
- Lesson 3 – Compound Boolean Expressions
- Lesson 4 – while Loops
- Lesson 5 – Implementing Selection and Iteration Algorithms
- Lesson 6 – for Loops
- Lesson 7 – Implementing String Algorithms
- Lesson 8 – Nested Iterations
Unit 3 Individual Lessons:
- Lesson 1 – Impacts of Program Design
- Lesson 2 – Program Design
- Lesson 3 – Classes and Constructors
- Lesson 4 – Accessor and Mutator Methods
- Lesson 5 – Class Variables and Methods
- Lesson 6 – References, Scope, and this
Unit 4 Individual Lessons:
- Lesson 1 – Ethical and Social Issues Around Data Collection
- Lesson 2 – Data Sets
- Lesson 3 – One Dimensional Arrays
- Lesson 4 – Array Traversals
- Lesson 5 – Implementing Array Algorithms
- Lesson 6 – Using Text Files
- Lesson 7 – Wrapper Classes
- Lesson 8 – ArrayList
- Lesson 9 – ArrayList Traversals
- Lesson 10 – Implementing ArrayList Algorithms
- Lesson 11 – 2D Arrays
- Lesson 12 – 2D Array Traversals
- Lesson 13 – Implementing 2D Array Algorithms
- Lesson 14 – Searching Algorithms
- Lesson 15 – Sorting Algorithms
- Lesson 16 – Recursion
- Lesson 17 – Tracing Recursive Output
- Lesson 18 – Recursive Searching and Sorting
If you need extra explanations or additional guidance, I would love to help!!
AP® is a trademark registered by the College Board, which is not affiliated with, and does not endorse, this product.
I want to provide the best possible resources to help other teachers out! You will be notified of any future updates and additions to this product and it will be free of charge. Your support is essential and I thank you for allowing me to continue doing what I love to do.
© Goldie’s Math Emporium, LLC
This work is bound by copyright laws and editing (beyond your own classroom use), selling, redistributing, or posting all or part of these documents on the Internet is strictly prohibited. Violations are subject to the Digital Millennium Copyright Act.




