AP Computer Science (Period 5) Assignments

Instructors
Term
2015-16 School Year
Department
Mathematics
Description

This course is equivalent to an introductory college level computer science course. Students taking this course should be familiar with the mathematical notation found in Algebra 2 as well as competence in written communication. Prior programming knowledge is not a prerequisite. Although much of the course will be centered on programming using JAVA, the course will also include an overview of the field of computer science. Course methodology will include discussion, research, and projects in as well as authoring, analysis, and applications of computer programming.

Files


Assignment Calendar

Upcoming Assignments RSS Feed

No upcoming assignments.

Past Assignments

Due:

Assignment

Elevens Lab: Start Exercises 6-10
CodingBat: AP-1
Final Project Planning
 
Next Class: 2 FRQs

Due:

Assignment

  • Free Response Question-30 minute time limit, peer scoring
  • Apple vs. the FBI-For Discussion on Tuesday March 1. You may work in groups of up to 3 students. Write responses to the **starred items.
    • All Writs Act. What is it and how does it apply?
    • CALEA. What is it and how does it apply?
    • **What is the FBI asking Apple to do?
    • **What is the FBIs position? (3 Sources)
    • **What is Apples position? (3 Sources)
    • **Should Apple honor the court order? Support your answer with evidence, not emotion.

Due:

Assignment

  • Elevens Lab-Parts 1-5
  • CodingBat: AP-1.   15 problems
 
  • Practice FRQ on Wednesday

Due:

Assignment

Discuss Daily Schedule FRQ
CodingBat: 15 questions from the AP-1 set. Complete by 3/17

Due:

Assignment

Free Response Question-Daily Schedule

Due:

Assignment

Practice Free Response Question Exercise

Due:

Assignment

Picture Lab QuickCode: Write two unrelated methods for the Picture class. Full value if complete by 11:45.
  • Write a method int getCountRedOverValue(int value) that returns a count of the number of pixels in the current picture that have a red value more than the parameter value.
  • Write a method setRedToHalfValueInTopHalf() that sets the red value for all pixels in the top half of the picture to half the current red value.
  • Modify the main method in the Picture class to test the two new methods

Due:

Assignment

Picture Lab Chromakey: Write a chromakey method that replaces the current pixel color with the color from another picture at the same row and column when the current pixel color is close to a specified color. In many movies, the actors are filmed in front of a green screen and then the green is replaced with a different background using a similar technique. This is an ungraded challenge problem

Due:

Assignment

Continue Picture Lab: Inheritance Discussion and continue working through PictureLab
 
Picture Lab: Steganography-Steganography is the science of hiding information in a picture. You can hide a black and white message inside a color picture by first changing all the red values in the original color picture to be an even value (by subtracting one if odd). Make a picture of the same size out of the message that will be hidden. Then loop through both the original picture and the message picture, setting the red value of a pixel in the original picture to odd (by adding one to it) if the corresponding pixel in the message picture is close to the color black. Write an encode method that takes the black and white picture message and changes the current picture to hide the message picture inside of it. Then also write a decode method that returns the picture hidden in the current picture.

Steganography Graded Projects-
  • Hide three different messages in one picture at the same time. One of the hidden messages must be a black and white (not grayscale) lineart image. You should be able to selectively choose which message to decode.
  • Embed a 3-bit rgb image inside of a picture.

Due:

Assignment

Quickcode- Using the files in the Inheritance QuickCode folder in the common drive, create EquilateralTriangle and RightTriangle classes that are derived from the abstract Triangle class. Provide an appropriate constructor for each of the classes and make them call the superclass's constructor. Redefine the abstract methods appropriately in the derived classes. Complete the declaration statements in the TriangleTester class. Compile all classes and run the TriangleTester. Full Value if complete by 12:00

Due:

Assignment

  • Introduce Pictures Lab (A1-A3)
  • HW for Thursday 1/21-AP Style multiple choice and free response (pp458-463)
  • Check Monetary Coin on Thursday 1/21
  • Inheritance QuickCode on Monday 1/25

Due:

Assignment

Monetary Coin Programming Project:
Design and implement a class called MonetaryCoin that is derived from the Coin class from Chapter 4. Store a value in the monetary coin that represents its value and add a method that returns ts value. Create a main driver class to instantiate ten coins. Flip each coin and return the sum of the coins that show heads.

Due:

Assignment

Fall Final Exam Review Sheet: The linked document contains the topics that may be tested on the Final Exam.  Review the list and ask questions about any topic that you do not understand.

Due:

Assignment

ArrayList Quickcode- Using the files in the ArraylistQC folder in the common drive, complete the employeeIsEligible() and processRetirements() methods of the Company class. Full value if completed by 11:55.
You should not need to change any class other than the Company class, but you will need to compile the other classes.
Use the CompanyTester class to check that it works correctly.  An employee is eligible for retirement if (s)he meets at least two of the following requirements.
  • The employee is at least RETIRE_AGE years old.
  • The employee has worked for at least RETIRE_YEARS years.
  • The employee's salary is at least RETIRE_SALARY.
 
Method processRetirements removes all retirement-eligible employees from ArrayList myEmployees and maintains the following conditions: the ArrayList is maintained in order by employee ID and myTotalSalary is the total of all salaries of the remaining employees.

Due:

Assignment

  • Searches and Sorts Discussion
  • Chapter 6 Programming Projects
  • HW: Read Textbook sections 6.2,6.3,8.3 on searches and sorts
  • ArrayList QuickCode on Friday: Completing methods in a class involving processing elements of an ArrayList. Also includes use of interfaces.

Due:

Assignment

ArrayList Discussion
  • Programming Projects Programming Project 6.1: Design and implement an application that reads a number of integers that are in the range 0 to 50 inclusive and counts how many times each one is entered. After all input has been processed, print all of the values with the number of times each one was entered.
  • Programming Project 6.2: Change the program from 6.1 so that it works for numbers from -25 to 25.
  • Programming Project 6.8: Using the Card class from project 4.6, Create a class called DeckOfCards that uses an ArrayList to store 52 objects that are instances of the Card class. Include methods to shuffle the deck, deal a card, and report the number of cards left in the deck. The shuffle method should assume you have a full deck. Create a driver class with a main method that deals each card from a shuffled deck, printing each card as it is dealt.

Due:

Assignment

  • Array Discussion
  • CodingBat: Array-1 and Array-2: 10 problems from each set
  • HW: Read Textbook section 6.0-6.1;

Due:

Assignment

  • Interface QuickCode:
    • Copy the Interface QuickCode folder from the common folder to your drive (available after instructions are given in class)
    • Compile all of the files in the folder
    • Create and compile class files for the Eggs, Bacon, and Juice classes that implement the edible interface
    • Run the BreakfastTest file to test completion of the project
    • Full Credit if complete by 11:20
  • Check programming projects for grading period
    • 4.4 (Boxcars)
    • 4.6 (Card)
    • 5.2 (Rational)
    • 5.6 (Lockable)

Due:

Assignment

  • Interface Discussion
  • Programming Project 5.2: Change the Rational class from Chapter 4 (available in the Common folder) so it implements the Comparable interface. To do the comparison, computer a floating point value from the numerator and denominator for both Rational objects, then compare them using a tolerance value of 0.0001. Write a main driver to test your changes.
  • Programming Project 5.6: Design a Java interface called Lockable that includes the following methods: setKey, lock, unlock, and locked. The setKey, lock, and unlock methods take an integer parameter that represents the key. The setKey method establishes the key. The lock and unlock methods lock and unlock the object, but only if the key used is correct. The locked method returns a boolean of true for locked and false for unlocked. A Lockable object is an object whose regular methods are protected: if the object is locked, the methods cannot be invoked. Redesign and implement a version of the Coin class so that it is Lockable.

Due:

Assignment

Writing Classes Quiz
Work on Chapter 4 Programming Projects
HW: Read Chapter 5- References, Aliases, Interfaces

Due:

Assignment

Chapter 4 Multiple Choice Questions discussion
Programming Project 4.6: Design and implement a class called Card that represents a standard playing card. Each card has a suit and a face value. Create a program that deals 20 random cards.

Due:

Assignment

Classes: Association, Aggregation, Inheritance, Encapsulation
Classes: Method and Constructor Overloading

Chapter 4 Multiple Choice Questions

Programming Project 4.3: Write an application that rolls a die and displays the result. Let the user pick the number of sides on the die. Use the Die class from the common folder to represent the die in your program.

Programming Project 4.4: Design and implement a class called PairOfDice, with two six sided Die objects. Create a driver class called BoxCars with a main method that rolls a PairOfDice 1000 times, counting the number of box cars (two sixes) that occur.

Due:

Assignment

Introduction to Classes
  • Types of Classes
  • Instance Data
  • Constructors
  • Methods
Programming Project 4.3: Write an application that rolls a die and displays the result. Let the user pick the number of sides on the die. Use the Die class from the common folder to represent the die in your program.

Due:

Assignment

Midterm Review Grid: Page 2
Midterm postponed to Friday 10/17 because of the PSAT
Grading Period ends Friday:
  • CodingBat Recursion-1
  • CodingBat String-2
  • AP-Style free response question 8.1
  • Textbook programming projects 3.6,3.10,3.14

Due:

Assignment

  • CodingBat: Recursion-1
  • CodingBat: String-2
  • Textbook programming projects 3.6,3.10,3.14
  • Iteration Quiz on Thursday 10/8. Be prepared to both read and write code using for and while loops.
  • Midterm on Wednesday 10/14
  • End of First Quarter Friday 10/16
  • HW: Complete Midterm Study Grid

Due:

Assignment

  • CodingBat: Recursion-1
  • CodingBat: String-2
  • Textbook programming projects 3.6,3.10,3.14
    • 3.6: Design and implement an application that determines and prints the number of odd, even, and zero digits in an integer read from the keyboard.
    • 3.10: Design and implement an application that plays the Hi-Lo gueesing game with numbers. The program should pick a random number between 1-100 (inclusive) then keep asking the user to guess the number. On each guess, report correct, high, or low. Use a sentinel value to determine whether the user wants to quit. Count and report the number of guesses. Give the user the option to play again.
    • 3.14: Design and implement an application that plays rock-paper-scissors against the computer. The program should randomly choose  an option and then ask for the user's selection. The program then reveals both choices and displays the result. Keep playing until the user chooses to stop then print the number of user wins, losses, and ties.
  • Iteration Quiz on Thursday 10/8
  • Midterm on Wednesday 10/14
  • End of First Quarter Friday 10/16

Due:

Assignment

  • Quiz: Recursion
  • Introduction to Iteration
    • While Loops
    • For Loops
    • Nested Loops
  • CodingBat: Recursion-1
  • CodingBat: String-2
  • HW: Read Textbook Section 3.5
  • HW: Read Think Java Chapter 7

Due:

Assignment

  • Recursion Quiz on Monday 9/28: You will be expected to trace recursive code to determine the result and be able to identify the base case and recursive case of a recursive method. You should know the dragon's three rules for recursion.
  • CodingBat: Recursion-1
  • AP-Style free response question 8.1 (textbook p. 510). See notes from 9/22 for additional directions.

Due:

Assignment

  • Check Magpie Graded Projects
  • CodingBat Recursion-1 (10 problems)
  • AP-Style free response question 8.1 (textbook p. 510). Include a main method to test the three methods. All methods must implement a recursive solution. Change the triple method to return three times the value of a passed int instead of working with an array. You may modify the parameters for the triple method if necessary.
public class MathUtils
{
  public static int factorial(int n){
 
  }
  public static int power(int base, int exp) {
 
  }
  public static int triple (int a) {
 
  }
}

Due:

Assignment

Checking Work for Progress Report: By end of period, bring up on screen:
  • one project from 2.6 or 2.7
  • one project from 2.8 or 2.12
  • With Partner, Magpie Graded project

Due:

Assignment

  • QUIZ: Conditionals and String methods.
  • Magpie Chatbot lab Activity 4.
  • Magpie Lab Graded Activity: With a partner, design and implement an upgrade to Magpie4. Write the intended modification and names of both students in comments at the top of the code before you begin coding. Your upgrade should add significant new vocabulary to what Magpie can understand. The code only needs to be in one students folder. (due by Friday, 9/18)
  • CodingBat continued: Complete at least 10 exercises from from each section: Warmup-1, String - 1, Logic-1
  • Next Class: Introduction to Recursion. Make sure that you have finished the reading from Think Java and Chapter 8

Due:

Assignment

  • Review: Complex conditionals and Truth Tables
  • QUIZ on Monday 9/14: Conditionals and String methods. Be prepared to trace code to determine the result and to write a simple method involving a conditional.
  • Magpie Chatbot lab Activity 4.
  • Magpie Lab Graded Activity: With a partner, design and implement an upgrade to Magpie4. Write the intended modification and names of both students in comments at the top of the code before you begin coding. Your upgrade should add significant new vocabulary to what Magpie can understand. The code only needs to be in one students folder. (due by Friday, 9/18)
  • CodingBat continued: Complete at least 10 exercises from from each section: Warmup-1, String - 1, Logic-1
  • HW: Read Textbook Section 8.0 and 8.1

Due:

Assignment

  1. CodingBat continued: Check portal for current completion scores
  2. Magpie Chatbot lab Activity 3. String API
  3. HW: Read Think Java Chapter 4 starting at section 4.8

Due:

Assignment

Introduction to Magpie Chatbot Lab
 
Copy Magpie Lab Folder from Common Drive to your G: Drive

Open the Magpie Lab Student Guide

Activity 1: Getting Acquainted with Chatbots. Work with a partner to experiment with chatbots. Be prepared to discuss the answers to the questions in the activity. http://sites.google.com/site/webtoolsbox/bots

Activity 2: Introduction to the Magpie Class. Open the Magpie2.java and MagpieRunner2.java files using jGrasp. Compile both classes. Complete Activity 2.

Due:

Assignment

Following the class discussion on math operations and the use of the Scanner class:
 
Programming Projects 2.2, 2.3, 2.6, 2.7
 
2.2 Write an application that reads three numbers and prints their average
2.3 Write an application that reads two floating point numbers and prints their sum, difference, and product.
2.6 Write an application that reads values representing a time in hours, minutes, and seconds. Then print the same time in seconds
2.7 Write an application that performs the reverse of 2.6. Read a value representing a number of seconds then print the same amount of time in hours, minutes, and seconds.

Due:

Assignment

Discussion: String Class
Discussion: Conditionals
Discussion: Anatomy of a method
Programming Projects 2.8,2.12
  • 2.8 Write an application that reads the x,y coordinates for two points. Compute and print the distance between the two points.
  • 2.12 Write an application that determines the total value of coins in dollars and cents using keyboard input for the number of quarters, dimes, nickels, and pennies. Use the currency formatter to print the output.
CodingBat: 10 problems each from Warmup-1, String-1, and Logic-1

Due:

Assignment

Syllabus Verification Form - This form must be returned with parent signature. 20 points by due date. 15 points if late

Due:

Assignment

Read Chapter 1 of Blown to Bits

Due:

Assignment

Blown to Bits part 2: Google Groups: Select at least 3 of the Koans from Chapter 1 of Blown to Bits. Post an example of what the Koan means. Do not use examples that are directly from the article.

Due:

Assignment

Read sections 1.0 through 1.2 in the textbook

Due:

Assignment

Inside the Computer Project: Describe how a computer works in two different ways.
Method 1: Words
Write a description of how a computer works. Do not need to be literal, but instead
demonstrate an understanding of the processes and logic involved in the internal
operation of the computer in non computer terms. You may not use any of the words on the restricted list below and you may only use the words “computer,” “device,” and
“system” three times each.
Restricted terms list: CPU, Central Processing Unit, Memory, RAM, ROM, Bit, Byte,
Chip, Motherboard, Drive
Method 2: Pictures
Create a pictorial representation of how a computer works. Again, do not be literal, but demonstrate an understanding of the processes and logic. You may not use pictures of actual computer components in your representation.