Unit 1 Lesson 2 Why Programming Why Java Lesson Plan
Unit 1 Lesson 2 Why Programming Why Java Lesson Plan
Overview
This lesson corresponds to the College Board topic 1.1 Why Programming? Why
Java? It introduces the Java programming language. By completing this lesson,
students learn how to compile Java source code into a class file and execute a
program. Students are given an opportunity to correct compiler errors in several
sample programs.
Note: If you wish to provide a URL/link for students to access this lesson, you
can replace “yourCustomCourseName” in the customized link below with the
name of your custom course that you created. However, Runestone will
automatically direct students who are logged in to your custom course from the
CSAwesome link. For instructions on how to set up a custom course, please see
https://www.csawesome.org/runestone-e-book.
MOD-1 Some objects or concepts are so frequently represented that programmers can
draw upon existing code that has already been tested, enabling them to write
solutions more quickly and with a greater degree of confidence.
1
Lesson Plan
Lesson 1.2: Why Programming? Why Java?
variables in their code so that the same algorithm runs using different input values.
Learning Activities
2
Lesson Plan
Lesson 1.2: Why Programming? Why Java?
draw a simple snowman. You may give them the following secret
snowperson handout.
○ Have the pairs sit back to back. One of the students should have paper and
a pencil or pen and be prepared to draw something simple. Do not tell the
drawing student what they will be drawing! The other student will give
that student instructions on how to draw a simple snowperson without
using body part or clothing words or the word snowperson (which is a
secret to the “draw-er”). The student drawing may not ask any questions
during the instructions.
○ Afterwards, have the “draw-er” show their picture. Ask the students
questions such as: Was the result a snowman? How exact did the
instructions need to be? Did the order of the instructions matter? What
kinds of problems occur because of the vagueness of the English
language?
○ Note this activity may take up to 30 minutes if you have extra time. If not,
3
Lesson Plan
Lesson 1.2: Why Programming? Why Java?
4
Lesson Plan
Lesson 1.2: Why Programming? Why Java?
5
Lesson Plan
Lesson 1.2: Why Programming? Why Java?
Differentiation: Enrichment
● Show students the use of an “escape sequence”. An escape sequence always
begins with a backslash and is followed by a letter which means something
“special” to Java. The escape sequence “\n” indicates for Java to move to the
“nextline”. Try placing an escape sequence inside a println(), such as:
System.out.println(“Hello\nthere”);
Background Knowledge
● A nice resource website for many Java questions can be found at Geeks for
Geeks. Here is a page relating to How to become a better Java programmer.
Teaching Tips
● CSP → CS A Tips
○ In CSP, the pseudocode provided for a println() statement would have been
DISPLAY(expression)
○ Students who have had Scratch would remember the command:
● The more students feel free to experiment with code, the better.
● Debugging tip: Only concentrate on fixing ONE error at a time and re-
compiling. Sometimes 3 errors could have been generated because of 1 missing
semicolon or a misplaced double quote.
● Use these Teaching Tips to help students with good programming style.
6
Lesson Plan
Lesson 1.2: Why Programming? Why Java?
After reviewing this lesson plan in the professional development, complete the form
found here to provide feedback on the lesson, materials provided, etc.
Attributions
“11 - Learn Java - Insert New Lines and Tabs into Screen Output.” 11 - Learn Java - Insert New
Lines and Tabs into Screen Output - Java Programming - Vol 1 - Variables & Core
Concepts - Math Tutor Public Gallery,
videos.mathtutordvd.com/detail/videos/java-programming---vol-
1---variables-core-concepts/video/r4kuDIcAte8/11---learn-java---
insert-new-lines-and-tabs-into-screen-output?
autoStart=true&page=CA8QAQ.
“How Do I Become a Good Java Programmer?” GeeksforGeeks, 25 Sept. 2018,
www.geeksforgeeks.org/how-do-i-become-a-good-java-programmer/.
“Java Programming Language.” GeeksforGeeks, www.geeksforgeeks.org/java/.
“Lay out What Good Programming Style Consists of for Your Class to Encourage Good Style and
Make Debugging Easier.” Csteachingtips.org, 9 July 2015, csteachingtips.org/tip/lay-out-
what-good-programming-style-consists-your-class-encourage-good-style-and-make-
debugging.