Copy of Walheim - CSA Unit 6 Guide (2023-2024)
Copy of Walheim - CSA Unit 6 Guide (2023-2024)
What are some other examples of where you have seen or experienced NLP?
What are some examples of where you think NLP could be useful?
Documentation
Based on our experiences with writing and reading each other's code, what are some best practices we should
follow when writing and documenting code?
1
CSA Unit 6 Guide
Javadocs Tags
@param
Adds a parameter with the specific description
@return
Adds a returns section with the description
2
CSA Unit 6 Guide
Lesson 2: Substrings
Smart Assistants
When we ask Siri questions, it performs a specific task or gives a response based on our question or
statement. But how does it know what task to perform or how to respond?
3
CSA Unit 6 Guide
String objects are immutable, meaning the contents of the
Reflection
Question of the Day: How can I analyze parts of a String object?
● Use the substring() method in the String class to retrieve a substring of a String object
● Use the indexOf() and substring() methods in the String class to find and replace specific characters
(circle one)
1 2 3 4 5
4
CSA Unit 6 Guide
1 1
2 2
5
CSA Unit 6 Guide
Integer and Double Classes
Integer Double
parsing
Integer Ranges
6
CSA Unit 6 Guide
Consider each of the following statements and determine if they are true or false. If it is false, explain why. If
you are unsure, explain why.
1. _______ Adding 1 to MAX_VALUE will not change the value, because the value has already met its
maximum limit and cannot increase.
Reasoning:
2. _______ An underflow error occurs when an operation makes an integer value less than its minimum.
Reasoning:
Automatically converts a
______________ to a
int x = 64;
autoboxing
_______________ of the Integer y = x;
7
CSA Unit 6 Guide
Automatically converts an
____
Reflection
Question of the Day: Why would I want to represent primitive values as objects?
What is the relationship between wrapper classes, integers, double values, and overflow/underflow?
8
CSA Unit 6 Guide
Lesson 4: ArrayLists
Storing User Input in a List
The Joyful Pastries Food Truck owner wants cashiers to enter customer orders into a list as they are received
so the baker can complete the orders from the list.
What if we don't know how many orders the owner needs to enter into the program? What would we need to
change in our solution?
9
CSA Unit 6 Guide
dynamic data
structure
mutable
ArrayList
Parameters:
Methods:
10
CSA Unit 6 Guide
Reflection
Question of the Day: Why would I use an ArrayList instead of an array?
What are two big ideas about ArrayLists that you think will appear again in our lesson next class?
11
CSA Unit 6 Guide
How can we do this with an ArrayList based on what we know about its structure?
1. _______ Dot notation and a method are used to access values in an ArrayList.
Reasoning:
Reasoning:
12
CSA Unit 6 Guide
Reflection
Question of the Day: How am I able to work with the data stored in an ArrayList?
Which parts or terms from today's class were new to you? Which parts do you recognize?
13
CSA Unit 6 Guide
A B C D E F G H
lexicographical order
I J K L M N O P
Q R S T U V W X
Y Z
14
CSA Unit 6 Guide
Reflection
Question of the Day: How can I determine if a list of String objects are in alphabetical order?
15
CSA Unit 6 Guide
Allows a ____________, or
_______________________ to an
generic type
ArrayList and is indicated by
____________
Reflection
Question of the Day: Why would I use generic types?
What is one goal you have for yourself in the next class?
16
CSA Unit 6 Guide
How is the remove() method different from how we would remove items from an array?
Similar Different
● ●
● ●
17
CSA Unit 6 Guide
Removing with an Enhanced for Loop
WORD BANK
Using an ______________________ while adding or removing elements from an ArrayList may cause
a __________________________________.
Using remove() with an ___________________ completely removes the element, shifting the rest of the
items.
18
CSA Unit 6 Guide
Reflection
Question of the Day: How is removing data from an ArrayList different from removing data from an array?
How does the idea of removing elements connect with what you already know?
19
CSA Unit 6 Guide
Create a concept map that illustrates the concepts and their relationships in response to this prompt.
20
CSA Unit 6 Guide
text segmentation
What steps would our programs need to take to obtain a word from a sentence?
stop word
21
CSA Unit 6 Guide
Reflection
Question of the Day: How can I use what I know about object-oriented programming and ArrayLists to
plan and implement algorithms?
How do you see String manipulation being used in software or apps that you use?
22