-
A.P. Computer Science
This web page is a useful reference for my A.P. Computer Science A course however it is no longer as updated as the information on itsLearning. Please check there first.
Welcome to A.P. Computer Science!
QUICK LINKS: Java API 7.0 - SNAP! - Java Au Naturel
Everyone should learn to code!Introduction
The AP Computer Science course at Columbus North H.S. is a full-year course in Java programming. The course is very lab based, incorporating projects such as Turtle drawing objects, RatBots, and the Classic Arcade Project as added challenges as we improve our programming and problem solving skills.
At the end of this course students have the option of taking the A.P. Computer Science exam. Scoring well on this exam could earn you college credit!
A.P. Computer Science A - Course Description (from College Board)
Many of our assignments are borrowed or adapted from these great computer science teachers and programs:
Stanford - Cal-Berkeley (SNAP) - Wyomissing HS (Minich) - Issaquah HS (Wortzman) - Schram (text) - Wittry - Java Concepts (Hortsmann) - C.C.S.U. (Jones)
Schedule, Assignments and Resources
If you choose to work ahead, please note that these assignments might change!!
Unit 10 - RatBots XV (4 weeks)
All of the information for the RatBots project can be found using the link above.
Unit 11 - Intro to animation, interfaces and polymorphism (1-2 weeks)
Arcade Engine classes
- Discussion: Animation Engine , interfaces, abstract classes, polymorphism
- The AnimationEngine project is available on the shared folder
- Assignment - animation challenges (worksheet)
Unit 12 - Large Group Project (2-3 weeks)
This project will involve collaboration and contributions from every student in the class.
Unit 13 - Classic Arcade Project (3-4 weeks)
You need to turn in a proposal for your project with:
1. Your name
2. Your project/game title
3. A short overview of the game/project
4. Screenshots and layout of what the game/interface will look like
5. A list of objects that you will need to code
6. A list of features your final game/project WILL include
7. Extra things your game/project MIGHT include if you have time
8. What you consider to be the most challenging part(s) of your project
Unit 14 - Recursion (1-2 weeks)
Recursion
- Towers of Hanoi discussion
- Fractals discussion
- Assignment - recursion program
Unit 15 - A.P. Review (2-3 weeks)
There is a cost of ~$84 to take the AP Computer Science Exam. Students choose whether to take the exam or not, however the entire class will take 2 weeks to review in preparation for the A.P. exam. This review will include a working through many released A.P. problems, presentations and discussions, and optional extra review sessions.
A.P. Exam Day - Tuesday, May 6th
Final Projects -
Class Rules and Procedures
- Students are expected to be on time. If a student is absent they should check the website and check in with the teacher to see what was missed, and make up that work in a timely fashion. Students are not permitted to do anything that affects their own or another student's ability to work and learn. Students are expected to be able to work both collaboratively and individually as needed.
- Students should not play games on the computers in the lab (unless you programmed them! - and even then you should get to work instead of playing games!)
- No touching another students mouse or keyboard. You are encouraged to collaborate and discuss programs; this is especially useful for troubleshooting. However, your final product should be your own work.
- All programs MUST be properly commented and indented. Your name should appear in a comment at the start of each class you write.
- You are expected to work outside of class on the required programs. (HOMEWORK!) Very few students will be able to finish the assigned programs using only the in class time.
- It is useful to have a jump drive, but not required.
- Students should back up their files often! Not working because 'your files are on a jump drive at home' is not acceptable.
Grades for this class will be determined by elements from four categories.
Programs - Assigned programs which can be completed in class or as homework are the largest part of your grade.
Homework - We will have a few homework assignments and often check them for completion before our discussion.
Quizzes - We will occasionally have written quizzes, lab quizzes and reading quizzes
Projects - We will have a few large scale projects with many graded elements.
If you get creative and make your own programs, show them for possible extra credit!
Resources
- BlueJ IDE (Integrated Development Environment) - (software we will use in this class) download for FREE to use at home!!!
- Eclipse
- NetBeans
- IntelliJ
- ADK
- JDK7 - Java Development Kit (also needed for programming) download for FREE to use at home!!
Classroom Netiquette
Columbus North Programming Style Guide
Previous week's schedules
Unit 1 - SNAP! Turtles (2 weeks)
Getting used to programming concepts by using blocks.
- SNAP! from Cal-Berkeley (Previously known as Build Your Own Blocks)
- SNAP Exercises #1 - Moving and Talking (see PPT slide #8)
- SNAP Exercises #2 - Squares (see PPT slide #10)
- SNAP Exercises #3 - Triggers (see PPT slide #12)
- SNAP Exercises #4 - Threads (see PPT slide #14)
- SNAP Exercises #5 - Loops (see PPT slide #20)
- SNAP Exercises #6 - Input (see PPT slide #24)
- SNAP Exercises #7 - Arithmetic (see PPT slide #26)
- SNAP Exercises #8 - Conditionals / Boolean (see PPT slide #32)
- SNAP Exercises #9 - Events - MarcoPolo (see PPT slide #34)
- SNAP Project - Turtles
- The final day to submit for full credit from this unit is Friday, August 15th.
Items may be submitted for half credit until Aug 22nd. - SNAP Extra Credit Project! - Space Invaders (This project can be turned in anytime during the first quarter for extra credit)
- PowerPoint - BYOB (Snap!) Basics (Wortzman)
Unit 2 - Java IDEs, hardware, and Hello World (0.5 weeks)
Just getting started with actual code...
- Get to know the BlueJ IDE... Run each of these four sample programs and edit them to create one of your own.
- Java virtual machine and Computer hardware - lecture notes by Cay Hortsmann
- BlueJ IDE (Integrated Development Environment) - (software we will use in this class) download for FREE to use at home!!!
- JDK - Java Development Kit (also needed for programming) download for FREE to use at home!!!
- Eclipse, NetBeans, IntelliJ and other IDE notes/discussion
Unit 3 - Classes, Objects and Methods (3 weeks)
Objects, classes, methods
Constructors, accessors, modifiers
Using the Java API- Role playing objects / designing role plays (in-class activity)
- General Resources for this Unit
- Notes on classes, constructors, methods and variables - Spock
- Notes on Classes - Constructors - Methods by Mr. Minich (a teacher from another school who has great online resources)
- ASSIGNMENT #1 -
- Read Java Au Naturel Chapter 1 - Objects
- Complete Exercises (You will find these throughout chapter 1 of the Java Au Naturel book.)
- #1.1 using a Turtle to draw a rectangle to the screen. - add more detail here...
- #1.5 drawing a hexagon.
- #1.7 drawing a house. (extra point possible for exceeding specification on this one.)
- #1.12 and #1.13 Add methods to StarTurtle to draw 5 and 6 pointed stars. Also write a test program to use these methods.
- #1.21 Five circles...
- Resources - You will need these files to complete this assignment. In BlueJ create a new project, and then create new java classes with these names and copy the code in place of the default code. (This will be demonstrated in class.)
- ASSIGNMENT #2 - Java Concepts - Ch.2 Using Objects(from our Java Concepts book)
- #1: Write a program that constructs a Rectangle object and then computes and prints its area. (Use the getWidth and getHeight methods.)
- #7: Write a program that uses the Random class to simulate the cast of a die, printing a random number between 1 and 6 each time the program is run. (You should use the nextInt method.)
- ~#9: Write a program that asks the user their name (perhaps use code from a previous project to do this) and then changes all of the vowels to numbers i1, a2, e3, o0, u4. Use the replace method in the String class. Test with enough names to be sure that it works in all cases.
- #10: Write a program that swithces the letters "e" and "o" in a String. (Hello World becomes Holle Werld) This one is tricky.
- Resources
- DEMOS - Notes from Spock on this assignment.
- Java API 7.0 - Documentation on all of the classes in the java library.
- Using Objects - lecture notes by Cay Hortsmann (this is a zip file.)
- ASSIGNMENT #3 - Java Concepts - Ch.3 Implementing Classes(from our Java Concepts book)
- #1: Write a program that constructs a bank account, deposits $2000, withdraws $700, withdraws another $400, and then prints the remaining balance. (The BankAccountTester class provides a good model for this.)
- #2: Add a method void addInterest(double rate) to the BankAccount class that adds interest at the given rate. (Also test to see that it works!)
- #3: Write a class SavingsAccount.
- It should be similar to the BankAccount class, except that it has an added instance field interest.
- Supply a constructor that sets both the initial balance and the interest rate.
- Supply a method addInterest (with no explicit parameter) that adds interest to the account.
- Write a program that constructs a savings account with an initial balance of $500 and an interest rate of 6%. The apply the addInterest method five times and print the resulting balance.
- #4: Implement a class Student.
- A student has a name and a total quiz score.
- Supply an appropriate constructor and methods getName(), addQuiz(int score), getTotalScore(), and getAverageScore().
- To compute the average score, you will also need to store the number of quizzes that the student took.
- Resources
- PPT discussion of Student class (Spock)
- Implementing Classes - lecture notes by Cay Hortsmann (try this link at school, since we can't download zips.)
- BankAccount class
- BankAccountTester class
- Practice Quiz #1 - ANSWERS - (due two days before the actual quiz.) Practice quizzes are fairly similar to the actual quizzes. They will help you prepare. Be sure to ASK QUESTIONS if you don't understand something on the practice quiz.
- QUIZ #1 (Classes, Methods, API, Java basics)
The final day to turn in assignments from this unit for full credit is Wednesday, September 10th
Unit 4 - Conditional Logic (2 weeks)
if and else keywords, boolean logic, boolean methods
- Notes on conditional logic (Spock)
- Decisions - lecture notes by Cay Hortsmann
- ASSIGNMENT #1 -
- Read Java Au Naturel Chapter 2 - Conditional Logic using Virtual CDs - Vic objects
- Complete exercises (You will find these throughout chapter 2 of the Java Au Naturel book.)
- #2.4 take from 2 & 4, put into 5
- #2.12 You will need to create a SmartVic class and add the methods movePut() and backTake() to accomplish this one. Make sure to use those methods in your code. You should be able to test this one with three filled slots ("111"). After running they should have changed from a-b-c to c-a-b.
- #2.15 You will add the swapTwo() method to your SmartVic class. (Your runner will be really simple.) If there are CDs in both the current and next slot then you will swap them and return the mover to the current slot. Otherwise, nothing should change (although it is okay if it changes and then it restored.)
- #2.27 You will add the putNextAvailable() method to your SmartVic class. When you write this method you can assume that the preconditions will be met. (Either this or the next slot will be empty, and the stack has a CD.) That way you only have to consider two slots in your coding. To make sure there is a CD in the stack, you could pick one up and move on before testing this method.
- Resources
- Vic.java
- Use these two lines of code (before constructing any Vic objects) to initialize to your liking.
String[] start = {"01010"}; //You choose the 1's and 0's you need.
Vic.reset(start);
- Use these two lines of code (before constructing any Vic objects) to initialize to your liking.
- listings of code for all other programs discussed in the chapter
- ASSIGNMENT #2 -
- Write a class QuadraticEquation
- The class should have three instance parameters to represent the coefficients for a quadratic equation in standard form y = ax^2 + bx + c. You may assume integer coefficients for this program.
- Provide a constructor QuadraticEquation(int aa, int bb, int cc) that receives the three coeficients for the equation.
- Write a method hasSolutions() that returns a boolean value that is true if the equation will have two solutions when y=0. Considering the quadratic formula, the method should determine whether the part under the square root (the disrciminant) will be positive, thus allowing solutions.
- Write a method firstSolution() that returns the larger of the two 'zeros' of the equation. Calculate this using the quadratic formula with a positive square root part. (Precondition: You may assume that such a solution exists.)
- Write a method secondSolution() that returns the smaller of the two 'zeros' of the equation. Calculate this using the quadratic formula with a negative square root part. (Precondition: You may assume that such a solution exists.)
- Write a method displaySolutions() that prints out the two solutions to the equation or prints out "No Solution" if there are no solutions. You MUST use the other methods within this method. Bonus: Handle the special case If there is only one solution.
- Be sure to write a tester class and test thoroughly before getting this checked off. Also be sure to comment! There will be deductions for programs that have no (or very few) comments.
- Write a class QuadraticEquation
- Resources
- (You may want to look back at the Student class notes since you are writing a class here.)
- (Extra notes for this QuadraticEquation project)
- ASSIGNMENT #3 -
- Homework assignment worksheets #1-4 (Use the black&white printer if needed.) This assignment will serve as the practice quiz.
- Resources
- if statements - lecture notes (Minich) these notes are VERY useful when working on the worksheets (and just in general too!)
- QUIZ #2 (Conditional logic + some review: Classes, Methods, API, Java basics)
Unit 5 - Iteration (2 weeks)
for / while / do-while
- ASSIGNMENT #1 -
- Read Java Au Naturel Chapter 3 - Loops and Parameters
- Complete exercises (You will find these throughout chapter 2 of the Java Au Naturel book.)
- #3.1 - Notes: To leave the 'executor' at the end, you can keep moving until you don't see a slot.
- #3.5 - Notes: You did this in the last chapter for only two slots, now it could be any number of slots until you find an empty. Use a while loop!
- #3.9 - Notes: This is quite similar to #5, except you need to return the Vic to where it was when the method started. Some code to do this is in the text (section 3.2)
- #3.19 - Notes: be sure to use the given code for fillOddSlots()
- Resources
- Vic.java
- Reminder: Use these two lines of code (before constructing any Vic objects) to initialize to your liking.
String[] start = {"01010"}; //You choose the 1's and 0's you need.
Vic.reset(start);
- Reminder: Use these two lines of code (before constructing any Vic objects) to initialize to your liking.
- listings of code for all other programs discussed in the chapter
- Vic.java
- ASSIGNMENT #2 -
- Homework assignment Iteration worksheets (Minich/Spock) (Use the black&white printer if needed.) This assignment will serve as the practice quiz.
- Resources
- looping statements - lecture notes (Minich) these notes are VERY useful when working on the worksheets (and just in general too!)
- ASSIGNMENT #3 - Java Concepts
- #1 - Using a Turtle, write a program that draws a square spiral. Here's an idea of what it should look like.
- #2 - Write a program that asks the user for an integer and then prints out all of its prime factors (including repeats). For example, when the user enters 150, the program should print out 2, 3, 5, 5. (You can format the ouput however you'd like.)
- To accomplish this task you will need a 'runner' class (which can handle the Input/Output) and a FactorGenerator class (which will do the number crunching.)
- #3 - Write a program that will ask the user for an integer and then print out all of the prime numbers up to that integer.
- Resources
- Extra notes for these problems - This is the most difficult set of problems you have had so far. Use the notes and remember to ASK QUESTIONS!!!
- Iteration Notes (Spock)
- Iteration - lecture notes by Cay Hortsman
QUIZ #3 (Iteration + some review)
There are extra credit assignments available if you finish this unit early. Ask for handouts.
- The final day to turn in problems from this unit is Friday, October 3rd
(Unit 5 - Assignment #3 problems will be accepted after fall break on Monday, October 20th)
Unit 6 - Magpie Chatbot Lab (1-2 weeks)
A.P. Computer Science A lab activity. This lab will give you the opportunity to apply some of the skills that you have developed in the previous units.
- ASSIGNMENT #1
- Read the student guide for the Magpie Chatbot lab. It is okay to read it by sections for each activity.
- Complete each activity in sequence. We will have class discussions daily to discuss what you have encountered.
- Use this page (you will be given a copy) to fill in your answers. This is the page you will turn in at the end of the lab.
- Activity #1 - Getting Acquainted with Chatbots
- Activity #2 - Introduction to the Magpie Class
- Activity #3 - Better Keyword Detection
- Activity #4 - Responses that Transform Statements
- We will save activity five for a later date after we have experience with arrays.
- ASSIGNMENT #2
- Sample A.P. style problems (handout)
Unit 7 - Arrays (1 week)
Arrays (square bracket [ ] operators)
- For each of the assignments below, you will need to write some form of 'runner' to test them.
- Assignment - write methods that find the sum, product, and average of an array of integers.
- Assignment - write method(s) that sort a list of integers in ascending order.
- Resources
- arrays discussions
- Extra Notes
- Powerpoint
- Assignment - Worksheet: using arrays.
The final day to turn in asignments from this unit for full credit is TBD.
Unit 8 - Lists (1 week)
ArrayList class (diamond < > operator)
- For each of the assignments below, you will need to write some form of 'runner' to test them.
- Assignment - Write a method that asks the user how many names (String) they would like to enter. Using an ArrayList, store the names.
- Assignment - Write a method that receives an ArrayList of Strings and sorts them into alphbetical order.
- Assignment - Write a method that receives an ArrayList of Strings and another String and adds that new string into the list in alphabetical order.
- Assignment - Write a method that receives an ArrayList of Strings and another String and removes all occurances of the new String from the ArrayList.
- Resources
- Discussion: ArrayList vs arrays / the ArrayList class / diamond operators
- Discussion: for - each loop structure
- Powerpoint
- Practice Quiz #4 - (due two days before the actual quiz.) Practice quizzes are fairly similar to the actual quizzes. They will help you prepare. Be sure to ASK QUESTIONS if you don't understand something on the practice quiz.
- QUIZ #4 (Arrays, Lists, ArrayLists and some review)
The final day to turn in asignments from this unit for full credit is TBD.
Unit 9 - Picture lab (and 2-D arrays) (2-3 weeks)
In this lab you will be writing methods that modify digital pictures. In writing these methods you will learn how to traverse a two-dimensional array of integers or objects. You will also be introduced to nested loops, binary numbers, interfaces, and inheritance.
- ASSIGNMENT #1
- Read the student guide for the Picture lab. It is okay to read it by sections for each activity.
- Get the code for the picture lab from the shared folder.
- Complete each activity in sequence. We will have class discussions daily to discuss what you have encountered.
- Use these pages (you will be given a copy) to fill in your answers. These are the pages you will turn in at the end of the lab.
- Activity 1: Introduction to digital pictures and color
- Activity 2: Picking a color
- Activity 3: Exploring a picture
- Activity 4: Two-dimensional arrays in Java
- Activity 5: Modifying a picture
- Activity 6: Mirroring pictures
- Activity 7: Mirroring part of a picture
- Activity 8: Creating a collage
- Activity 9: Simple edge detection (optional)
- ASSIGNMENT #2
- Sample A.P. style problems (handout)
The final day to turn in asignments from this unit for full credit is TBD.
Mr. Michael Spock - spockm@bcsc.k12.in.us