AP Computer Science (Period 3) Assignments

Upcoming Assignments RSS Feed

No upcoming assignments.

Past Assignments

Due:

Assignment

Due:

Assignment

JavaBat 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

Read: ThinkJava, Chapter 14 - Objects of Arrays

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

Read: ThinkJava, Chapter 13 - Arrays of Objects

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

A LITTLE QUIZ ON ARRAYS

JavaBat - Array 2 (remember to log in)

Due:

Assignment

Read: ThinkJava, Chapter 12 - Arrays

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 TimeSpan object storing the given time span of minutes and seconds.
  • 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.75 for (9 hours, 45 min).

  • getTotalMinutes
    • Returns the total time in a TimeSpan as the total number of minutes.
  • addTimeSpans
    • Takes 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".
  • 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

Read: ThinkJava, Chapter 11 - Create your own objects

Complete: Chapter 11 Exercise Template
DUE:
  • Wed 2/20 Exercises 1 & 2
  • Fri 2/22 Exercise 3

Due:

Assignment

Read: ThinkJava, Chapter 10 - GridWorld: Part 2

Complete: Chapter 10 Exercise Template
  • Wed 1/30 GridWorld Student Manual, Part 2
  • Th 1/31 Exercises 2-3
I am going to assign groups to facilitate a review/discussion of the different exercises from Chapter 10. Each group should be ready to share their work on their assigned exercise and answer questions. They should also be prepared to facilitate any discussion on the exercise. See the attached file for group assignments. I expect you to be ready on Monday, 2/4. We will not necessarily present the exercises in order.

Group Assignments Doc

Due:

Assignment

Read: ThinkJava, Chapter 9 - Mutable Objects

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

Winter Vacation 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

Fall Final - QuizStar

# 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

Due:

Assignment

CodingBat (remember to log in)

Let's play with Strings & Loops!
Java > String-2>

Due:

Assignment

CodingBat (remember to log in)

Let's play with Strings & Loops!
Java > String-2>

Due:

Assignment

CodingBat (remember to log in)

Let's play with Strings & Loops!
Java > String-2>

Due:

Assignment

Due:

Assignment

CodingBat (remember to log in)

Let's play with RECURSION!
Java > Recursion-1 >

Due:

Assignment

PracticeIt! (remember to log in)

You should also review and complete ALL problems from the Chapter 5 Test that you were unable to complete successfully.

Due:

Assignment

Due:

Assignment

QUIZ: CHAPTER 5 (GridWorld - Pt. 1)

Due:

Assignment

Read: ThinkJava, Chapter 6 - Value Methods

Complete: Chapter 5 Exercise Template (due Thursday, November 1)

Due:

Assignment

CLEAN UP CODE
  • 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.
Chapter 5 exercises are due at end of today, but may be turned in Monday at the beginning of the period. Have them in the inbox before the bell rings.

Due:

Assignment

Due:

Assignment

Due:

Assignment

Read the Following:
CodingBat Java help pages: Java String
Complete:
Java - Warmup-1 - notString (let's do this together)

Java - Warmup-1 - missingChar (try this on your own)

Due:

Assignment

QUIZ: CHAPTER 4

Due:

Assignment

Due:

Assignment

CodingBat (remember to log in)
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

Due:

Assignment

Due:

Assignment

Due:

Assignment

Due:

Assignment

Review ThinkJava Chapter 1

The Way of the Program

Focus on vocabulary

Due:

Assignment

Begin Learning Java Programming Language

Read the following JavaBat help pages:

Challenge - Can you complete the first Java Warmup Problem in JavaBat

Java > Warmup-1 > sleepIn

DO NOT LOOK AT THE SOLUTION - IT IS OK TO STRUGGLE

Due:

Assignment

Log into ALL Accounts:
  • Mymail
  • Practice It!
  • CodingBat
  • QuizStar
  • DropBox
Send Email:
  • To Mr. Merriman (use contacts)
  • CC Yourself
  • Subject: Signature Check, Period 3, APCS


Due:

Assignment

Group Assignment:

As a group (I will created them), see if you can find a solution to Practice It! problem on Legal Identifiers.

Self-Check 1.6: legal identifiers