AP Computer Science (Period 3) Assignments
- Instructors
- Term
- 2012 - 2013
- Department
- Computers
- Location
- 208
Files
Upcoming Assignments
No upcoming assignments.
Past Assignments
Due:
Assignment
Due:
Assignment
Due:
Assignment
Try these:
BJP3 Exercise 1.16: Shining
(id #1848) BJP3 Exercise 2.12: nestedNumbers
(id #1890) BJP3 Exercise 7.4: isSorted
(id #2079) BJP3 Self-Check 8.9: methodCallSyntax
(id #2097) Due:
Assignment
Complete JavaBat Array-1 Section: (27 problems)
Do a minimum of one problem a night, beginning tonight.
You should be complete with the section no later than April 3.
Due:
Assignment
Complete: Chapter 14 Exercise Template
You may submit the completed exercises via email when complete.
Be ready to discuss and complete the chapter exercises with your group and class after Spring Break. The more work you have completed prior to class, the better position you will be in to learn the material well. The point of class time is to review and discuss what you've already done, and clarify what you're struggling with. All exercises will be due at the beginning of class on Tuesday, 4/2. Any work templates submitted subsequent to that will be considered late work.
DUE:
- Tues 4/2 All Exercise
Due:
Assignment
Complete: Chapter 13 Exercise Template
You may submit the completed exercises via email when complete.
Be ready to discuss and complete the chapter exercises with your group according to the schedule outlined below. The more work you have completed prior to class, the better position you will be in to learn the material well. The point of class time is to review and discuss what you've already done, and clarify what you're struggling with. All exercises will be due at the end of class on Tuesday, 3/22. Any work templates submitted subsequent to that will be considered late work.
DUE:
- Wed 3/20 Exercise 1-2
- Wed 3/22 Exercise 3-4
- Any work done with Exercise 5 will be counted as extra credit
- All work will be due at end of period on 3/22
Due:
Assignment
JavaBat - Array 2 (remember to log in)
Due:
Assignment
Complete: Chapter 12 Exercise Template (to be uploaded)
Be ready to discuss and complete the chapter exercises with your group according to the schedule outlined below. The more work you have completed prior to class, the better position you will be in to learn the material well. The point of class time is to review and discuss what you've already done, and clarify what you're struggling with. All exercises will be due at the end of class on Thursday, 3/14. Any work templates submitted subsequent to that will be considered late work.
DUE:
- Tues 3/12 Exercises 1-6
- Wed 3/13 Exercises 7-10
- Thur 3/14 Exercises 11-15
Due:
Assignment
THIS IS A GROUP ASSIGNMENT/PROJECT
Using Eclipse, create a Java Project named TimeSpan.
Define a class named TimeSpan. A TimeSpan object stores a span of time in hours and minutes (for example, the time span between 8:00am and 10:30am is 2 hours, 30 minutes). Each TimeSpan object should have the following public methods:
-
TimeSpan(hours, minutes)- Constructs a
TimeSpanobject storing the given time span of minutes and seconds.
- Constructs a
- Write two contructors:
- without parameters
- with parameters
-
getHours- Returns the number of hours in a TimeSpan.
-
getMinutes- Returns the number of minutes in a TimeSpan, between 0 and 59.
isGreater- Compares two TimeSpans and returns a boolean indicating if the first is greater than the second.
add(hours, minutes)- Adds a given amount of time to a TimeSpan. For example, (2 hours, 15 min) + (1 hour, 45 min) = (4 hours). Assume that the parameters are valid: the hours are non-negative, and the minutes are between 0 and 59.
-
add(timespan)- Adds the amount of time stored in a TimeSpan to a TimeSpan and returns a new TimeSpan containing the result.
-
getTotalHours- Returns the total time in a TimeSpan as the real number of hours, such as
9.75for (9 hours, 45 min).
- Returns the total time in a TimeSpan as the real number of hours, such as
getTotalMinutes- Returns the total time in a TimeSpan as the total number of minutes
.
addTimeSpansTakes three TimeSpans and adds the first two, storing the result in a third.
printTimeSpan- Returns a string representation of the TimeSpan of hours and minutes, such as
"28h46m".
- Returns a string representation of the TimeSpan of hours and minutes, such as
main- Create at least three TimeSpan objects demonstrating both constructors above.
- Test ALL methods created above.
- Use single-line comments to label method types. (constructor, pure, modifier, fill-in )
The minutes should always be reported as being in the range of 0 to 59. That means that you may have to "carry" 60 minutes into a full hour.
Whenever possible, you should use existing methods when writing methods.
When complete, group leaders should use PasteBin to share the code with their group members. Share with Mr. Merriman as well.
Due:
Assignment
Complete the following PracticeIt! problems:
Due:
Assignment
Complete: Chapter 11 Exercise Template
DUE:
- Wed 2/20 Exercises 1 & 2
- Fri 2/22 Exercise 3
Due:
Assignment
Complete: Chapter 10 Exercise Template
- Wed 1/30 GridWorld Student Manual, Part 2
- Th 1/31 Exercises 2-3
Due:
Assignment
Complete: Chapter 9 Exercise Template (due Friday 1/25)
- Wed 1/24 Exercises 1-4
- Fri 1/25 Exercises 5-6
Due:
Assignment
Chapter 8 : ChaseRunner
Exercise 13 (Group Work)If you did the GridWorld exercises in Chapter 5, you might enjoy this exercise. The goal is to use trigonometry to get the Bugs to chase each other.
Make a copy of BugRunner.java named ChaseRunner.java and import it into your development environment. Before you change anything, check that you can compile and run it.
- Create two Bugs, one red and one blue.
- Write a method called distance that takes two Bugs and computes the distance between them. Remember that you can get the x-coordinate of a Bug like this:int x = bug.getLocation().getCol();
- Write a method called turnToward that takes two Bugs and turns one to face the other. HINT: use Math.atan2, but remember that the result is in radians, so you have to convert to degrees. Also, for Bugs, 0 degress is North, not East.
- Write a method called moveToward that takes two Bugs, turns the first to face the second, and then moves the first one, if it can.
- Write a method called moveBugs that takes two Bugs and an integer n, and moves each Bug toward the other n times. You can write this method recursively, or use a while loop.
- Test each of your methods as you develop them. When they are all working, look for opportunities to improve them. For example, if you have redundant code in distance and turnToward, you could encapsulate the repeated code in a method.
Due:
Assignment
Complete Following JavaBat Sections:
Explore the following help file and try transforming your while loops into for loops:If you're brave and bored, try:
If you're still bored, read the help sections on Java Arrays and Loops and try:
Due:
Assignment
# 51 Method 'isVowel', boolean
Check to see if single letter string is vowel or not.
#53 Method 'printLetters', void
Print letters of string sequentially, separated by ', ' (comma,space)
example w, o, r, d (note last letter is not followed by comma/space
#54 Method 'printMultiples', two int parameters (n,m), void
Prints multiples m multiples of n thus: printMultiples(2,4)
The first 4 multiples of 2 are 2, 4, 6, 8
Due:
Assignment
Complete: Chapter 8 Exercise Template (due Monday 11/26)
Due:
Assignment
Due:
Assignment
Due:
Assignment
Due:
Assignment
Complete: Chapter 7 Exercise Template (due Monday 11/26)
Due:
Assignment
You should also review and complete ALL problems from the Chapter 5 Test that you were unable to complete successfully.
Due:
Assignment
Due:
Assignment
Due:
Assignment
Complete: Chapter 5 Exercise Template (due Thursday, November 1)
Due:
Assignment
- Pay attention to Eclipse warnings - You should eliminate all of them
- Remove extraneous code
- Remove the 'Unbounded' grid from randomBug
- Indent properly and brace you 'if/else' statements
- Do not use Global Variables, not yet . . . we'll get there, but let's talk about them
- Make sure you understand the nature of Local Variables
- Think about how you name variables, be logical and sensible
- Use moveBug in randomBug
- Color your bugs in colorBug and use colorBug in makeBug (this is incremental development)
- Use intermediate variables in colorBug & makeBug
- Build incrementally
- Remember, it is not necessary to state the obvious. If something is not true, it is by definition false. At least where booleans are concerned.
Due:
Assignment
CodingBat Java help pages: Java StringComplete:
Java - Warmup-1 - notString (let's do this together)
Java - Warmup-1 - missingChar (try this on your own)
Due:
Assignment
Due:
Assignment
Due:
Assignment
Due:
Assignment
Java > Warmup-1 > icyHot
Java > Logic-1 > dateFashion
PracticeIt! (remember to log in)
Self-Check 1.13: Test of Knowledge
Due:
Assignment
Due:
Assignment
Due:
Assignment
Due:
Assignment
Due:
Assignment
- Mymail
- Practice It!
- CodingBat
- QuizStar
- DropBox
- To Mr. Merriman (use contacts)
- CC Yourself
- Subject: Signature Check, Period 3, APCS
Due:
Assignment
As a group (I will created them), see if you can find a solution to Practice It! problem on Legal Identifiers.