00 - Unit 1 Guide
00 - Unit 1 Guide
When something doesn’t follow the language or pattern that the rest of the code follows.
2
CSA Unit 1 Guide
Reflection
Question of the Day: What are some of the primary components of a Java program?
How did you use your software engineering skills and characteristics to find and fix syntax errors today?
I used my problem solving skills to find syntax errors as it was hard at first, but I didn’t give up and was
able to fix multiple syntax errors.
3
CSA Unit 1 Guide
Lesson 3: Classes and Objects
Defining a Blueprint
Draw a house in the space provided below. Don't worry about making it perfect!
Follow along with the video and write your own class here.
4
CSA Unit 1 Guide
Consider your own neighborhood and the things that are in it. If you were to represent your neighborhood as a
collection of classes, what classes would your neighborhood consist of?
A painter that can paint stuff, a store where you can buy things, trees, parks. The house could be a class
too.
xLocation
yLocation These represent the Painter's
direction Characteristics of an object
remainingPaint ____________________________
5
CSA Unit 1 Guide
turnLeft()
move() These represent the Painter's
paint("color") The actions that an object can perform
takePaint() ____________________________
Reflection
Question of the Day: What is object-oriented programming?
Learner is one of our four characteristics of a software engineer. How did you engage your curiosity as a
learner throughout this class period?
6
CSA Unit 1 Guide
I was able to absorb the new information I’d learned to help me finish the lesson.
7
CSA Unit 1 Guide
Lesson 4: Instantiating Objects
Video Notes: Creating Objects
How is memory in a computer like the land a house is built on?
What is the relationship between a Painter object and the Painter class?
8
CSA Unit 1 Guide
Reflection
Question of the Day: How do I create objects from a class?
Now that you know about classes and objects in Java, what type of program are you looking forward to
creating? What objects would you represent in your program?
I want to create a program where you can paint many different things. I would have a painter in it, and the
objects I’d like to paint such as a house and more.
9
CSA Unit 1 Guide
Lesson 5: Methods
Giving Instructions
Write your instructions for the delivery driver here.
Head down on 1st street until you reach 5th street, turn left, move 4 squares until u reach 5th street and 5th
avenue and move 5 units Move 2 squares to the left, turn right, and move 3 up
Think of an object you might represent in a program, like a pet or a song. What behaviors would this object
have? What methods would the class have to represent these behaviors?
10
CSA Unit 1 Guide
I would probably use turnLeft and move and paint a lot because id want to create a painting.
1 Argument is a value passed to the method when 1 U can make things other than a painter
the method is called
11
CSA Unit 1 Guide
Reflection
Question of the Day: How do I give instructions to an object in Java?
How is giving instructions to a computer similar to giving instructions to a person? How is it different?
It’s similar because both of them have to deal with someone who needs guidance
12
CSA Unit 1 Guide
Lesson 6: Methods with Parameters
Instructions with Inputs
Consider our delivery driver from earlier. Before we could give our instructions for how to reach the destination,
what information did we need to know first?
The name of the delivery driver, which class it was in (public or private), the location ur at initially, and the
place you need to go to.
13
CSA Unit 1 Guide
Reflection
Question of the Day: How can I give a specific value for a method to use?
Based on what you now know about the Painter class, what are some things you might want to do or create
in The Neighborhood?
14
CSA Unit 1 Guide
Lesson 7: Loops
Components of an Algorithm
What do you know or remember about algorithms?
Sequencing
____________________________________
Selection
____________________________________
Iteration
____________________________________
15
CSA Unit 1 Guide
What are some scenarios that you can think of where you would want to know if something is either true or
false? Why might you need to know that?
Someone’s age (something’s are illegal), if someone’s sick (they might be pretending so they don’t have to
go to school), the weather.
while (checkForPlate()) {
putAwayPlate();
}
16
CSA Unit 1 Guide
Reflection
Question of the Day: How can the problem-solving process help me plan and implement an algorithm?
It helps you understand what you’re supposed to do, helps you plan, and make sure that you’re fully
confident in your code
What parts of this lesson made you feel confident in your work? What would you like to practice some more?
The while loop was really fun to use and made it so much simpler to just finish all the work. I had to put
less effort.
17
CSA Unit 1 Guide
Lesson 8: Inheritance
Object-Oriented Programming Concept Map
What is object-oriented programming?
Create a concept map that illustrates the concepts and their relationships in response to this prompt.
18
CSA Unit 1 Guide
Annotate this line of code using the vocabulary from the video.
Inheritance
19
CSA Unit 1 Guide
Writing a Subclass
Our Java programs now consist of two types of classes.
Attributes_______________ and
________behaviors________.
________________running.
What happened when you called Painter class methods? Why do you think this happened?
It didn’t work because I believe it needed the painter plus object rather than the painter object.
20
CSA Unit 1 Guide
Reflection
Question of the Day: Why would I use inheritance?
Think of a board game, card game, or video game that you play. How could an element of your game be
represented by a class? What elements could be represented with subclasses?
We could represent snakes and ladders through creating a subclass for the snakes, a subclass for the
ladder and a subclass for the board.
21
CSA Unit 1 Guide
Lesson 9: Writing Methods
Video Notes: Writing a Method
Annotate this method using the vocabulary from the video.
22
CSA Unit 1 Guide
Reflection
Question of the Day: How do I write methods for the behaviors I want an object to have?
You can write public void *command you want* and then write the methods that will allow you to use that
command.
What other methods would you want to add to the PainterPlus class?
23
CSA Unit 1 Guide
Lesson 10: Programming Style and Feedback
Software Engineers
How have you grown as a software engineer so far in this unit?
I’ve become more collaborative and love to bounce ideas off my fellow classmates as it helps us get the
best results in a productive time frame.
24
CSA Unit 1 Guide
So that we don’t waste time rewriting code we already know and can use our time efficiently.
TAG:
1 Code reviews are important because they ensure 1 They make the person writing the code a better
the success of your code and your products. person as well
2 Look for common errors 2 Code review helps bring in many different
perspectives.
25
CSA Unit 1 Guide
Reflection
Question of the Day: How do software engineers use feedback from peers?
They use it to make their code neater, faster, and to just get a different perspective from their coworkers.
What is a skill you are currently practicing that you would like feedback on?
26
CSA Unit 1 Guide
Lesson 11: Selection Statements
Components of an Algorithm
How do you think we would implement selection in Java?
There are certain codes that provide the same results, we might implement selection in terms of what
keeps our code looking clean and not messy.
Follow along with the video and write your own conditional statement here.
If (age>= 16) {
Obtain license ();
}
27
CSA Unit 1 Guide
Reflection
Question of the Day: How can I write algorithms using sequencing, selection, and iteration in Java?
What parts of this lesson made you feel confident in your work? What would you like to practice some more?
Probably being able to review my work and using selection made me confident in my work. I’d like to
practice more of subclasses tho.
28
CSA Unit 1 Guide
Lesson 12: Debugging Strategies
Bugs and Debugging
What do you know or remember about bugs and debugging?
I think bugs are like problems with your code and debugging is probably trying to fix that problem.
29
CSA Unit 1 Guide
Whatever is inside the parenthesis is printed to the console, so we can see what we’re doing wrong if it
doesn’t come out the way it’s supposed to.
Write a sample print statement that prints "Fido's age: " followed by the age stored in the fido object.
How might variables, the methods that return information about a Painter object, and printing be helpful when
we are writing our code?
They can tell us what’s true and what’s false and help us decide what methods to use in order to get the
results that we’re working towards.
30
CSA Unit 1 Guide
Reflection
Question of the Day: How can I use the problem solving process to debug a program?
We can reflect on our code and look for common syntax errors in order to debug a program.
How were you able to use System.out.println() to find and fix errors in your code?
They provided me the information I needed on where my object was and it helped me write a code that
achieved the goals we wanted to accomplish.
31
CSA Unit 1 Guide
And 1 to a variable associated with that color when removing the M&Ms
I think it means when something is done FAST without wasting any time.
32
CSA Unit 1 Guide
When something is repeated over and over, it’s not organized. So we can use methods to make
something do something over and over again.
33
CSA Unit 1 Guide
Reflection
Question of the Day: How can I write efficient code?
We can create a code for it in a subclass so we don’t have to repeat things over and over again.
What parts of this lesson were similar to things you have encountered in your life?
In a school, there’s classes, and several of them but when you look at it from a bigger perspective the
school is also a subclass of a district which is a subclass of the education system.
34
CSA Unit 1 Guide
1 “If-else statement” 1 The logical operator and the else branch perform
the same task.
How can two-way selection statements and the NOT ( ! ) operator be useful in the algorithms we have
developed so far?
35
CSA Unit 1 Guide
When something is untrue, it provides an alternative statement rather than having to write long lines of
code that will make the Boolean value to be correct. It’s just really effective.
Reflection
Question of the Day: How can I check if a condition is NOT true or execute a separate block of code if the
condition is false?
You can use the exclamation mark as it will return to you a Boolean value which will tell you whether or not
a statement is true.
Based on the feedback you received in your code review, what is one goal you have for yourself as you write
code in the future?
I want to be more independent and rely on the slides a little bit less.
36