AP Computer Science-2021 - 2022 Assignments
- Instructor
- Rich J Bell
- Term
- 2021-2022 School Year
- Department
- Mathematics & Computer Science
- Description
-
Upcoming Assignments
No upcoming assignments.
Past Assignments
Due:
This year, from June 3-6, the Bergen County Academies CTF team will be running BCACTF 3.0, a full-fledged cybersecurity capture the flag (CTF) competition for high schoolers similar to picoCTF. The Bergen County Academies (BCA) CTF club has spent the past several months writing tons of fun and unique problems, and it's finally ready to play!
If you’re looking for a way to explore cybersecurity, CTFs are perfect for you. Whether you are a CTF veteran or just learning how to code, CTFs are fun, intense, and engaging team competitions that put your skills to the test.
All US high school students are eligible for prizes from a pool of prizes worth $3000, so form a group of up to five friends and get ready to compete against other teams. If you’ve played many CTFs before, or even if you have never done a CTF in the past, BCACTF 3.0 will be a very enjoyable experience for all skill levels!
You can find more information at https://play.bcactf.com/. Good luck and enjoy!
This is optional
Submit the names of your teammates & team name to this assignment.
At the end of the event, the CHS team with the most points will earn a prize for each member!
If you’re looking for a way to explore cybersecurity, CTFs are perfect for you. Whether you are a CTF veteran or just learning how to code, CTFs are fun, intense, and engaging team competitions that put your skills to the test.
All US high school students are eligible for prizes from a pool of prizes worth $3000, so form a group of up to five friends and get ready to compete against other teams. If you’ve played many CTFs before, or even if you have never done a CTF in the past, BCACTF 3.0 will be a very enjoyable experience for all skill levels!
You can find more information at https://play.bcactf.com/. Good luck and enjoy!
This is optional
Submit the names of your teammates & team name to this assignment.
At the end of the event, the CHS team with the most points will earn a prize for each member!
Due:
Your task is to put together a proposal for what you plan on working on for the remainder of the school year. This is the only thing we will be doing in class, but you can work on it outside of classtime if you choose. Everyone will be presenting at the end of the school year on what you have accomplished during the time allowed.
The written proposal that you will submit should include everything listed in this document and anything else I should know. We will review your proposals in class over the next few days and being working on our projects.
The written proposal that you will submit should include everything listed in this document and anything else I should know. We will review your proposals in class over the next few days and being working on our projects.
Due:
During ClassMC - Monday
MC - Tuesday
OE - Thursday
OE - MC - Friday (Toss up)
Homework
Monday - OE due Tuesday
Tuesday - OE due Thursday
Thursday - OE due Friday
Complete as many AP-1 questions on Codingbat as possible.
Effort is this final grade before the AP Test. I will keep track of your progress in the note for this assignment on PowerSchool
MC - Tuesday
OE - Thursday
OE - MC - Friday (Toss up)
Homework
Monday - OE due Tuesday
Tuesday - OE due Thursday
Thursday - OE due Friday
Complete as many AP-1 questions on Codingbat as possible.
Effort is this final grade before the AP Test. I will keep track of your progress in the note for this assignment on PowerSchool
Due:
Complete the first 3 plus one more in the recursion section. Fibb & factorial should be easy because we discussed them in class. Practice with them, then complete 4 (including the first 3).
Due:
By the end of class on Monday, I would like you to complete these two problems.
There will be an addition on Monday to the second problem to ensure you understand the process.
There will be an addition on Monday to the second problem to ensure you understand the process.
Due:
Finish String 2 (21 total, 15 done so far)
5 more Array 2 (15 total, 10 done so far)
5 more Array 2 (15 total, 10 done so far)
Due:
Freshman frosh = new Sophomore();
Student soph = new Sophomore();
Junior Jun = new Junior();
Senior Sr = new Student();
Student soph = new Sophomore();
Junior Jun = new Junior();
Senior Sr = new Student();
Due:
In your groups, build a subclass to your student class that matches your assignment (FR, SO, JR, SR). Add in 2 instance variables, int stress and _____ where it is class specific.
Create the constructors with no parameters and with all parameters. Utilize super to shorten your code.
Add accessors for the two new variables.
Modify the goToSchool and dayOff methods to include the two new instance variables.
Create the constructors with no parameters and with all parameters. Utilize super to shorten your code.
Add accessors for the two new variables.
Modify the goToSchool and dayOff methods to include the two new instance variables.
Due:
Log onto AP Classroom and review the videos I checked off for you on Chapter 9. Watch them first, try out some of the code they are creating and talking about. Then work in groups or alone on the Classes "quiz" I set up. Use your computer to test code.
When you are done, I want you to post in a private note on this assignment in google classroom the (at least) 3 different takeaways that you had from these questions and their answers. If you have any follow up questions, ask them to your neighbors then ask here.
When you are done, I want you to post in a private note on this assignment in google classroom the (at least) 3 different takeaways that you had from these questions and their answers. If you have any follow up questions, ask them to your neighbors then ask here.
Due:
Finish your student class.
Private instance variables
public constructors
public accessors (get methods)
public mutators (set methods)
Tomorrow we will work on Tester classes, toString and the next steps
Private instance variables
public constructors
public accessors (get methods)
public mutators (set methods)
Tomorrow we will work on Tester classes, toString and the next steps
Due:
Using the description on the handout, produce a class that will act accordingly. Then build a tester class to test your program. I will use my tester class to grade your assignment.
Due:
Create the following tester program using the Door class given. Set it up to answer the attached, and then when you determine the pattern to the doors post your resulting explanation of the pattern here.
Due:
Review these notes on Classes. Build a BankAccount class and a BankAccountTester in the same project. Make the tester your Main class to make it easier when running. Create the instance variable for the balance, constructor for building a BankAccount object with a parameter for balance, methods for deposit and withdraw and getBalance according to the notes. Test your program by creating a BankAccount object in your tester class, deposit money and withdraw money, then output the balance. We will be expanding this class tomorrow.
Due:
Create a program that will ask for the integer values in a 3x3 array and fill the array in row major order.
Then check if it is a magic square:
None of the entries in the 2D array are the same - they are the values from 1 to 9 (3x3, they would be 1 to 16 in a 4x4).
There is a sum that all of the below add to.
-Each row adds up to that number
-Each col adds to that number
-Both Diagonals add to that number
Have the program print out whether or not it is a magic square.
Test
1 1 1 1 1 1 1 1 1 (false)
1 2 3 4 5 6 7 8 9 (false)
8 1 6 3 5 7 4 9 2 (true)
Part 2:
Fork your program (to save your original) and expand on the program to accept an input from the user to say how many rows/cols your square has before accepting the values in each row/col. Return whether or not the inputted square is a magic square. Attached is a document with test cases for varying sizes.
Then check if it is a magic square:
None of the entries in the 2D array are the same - they are the values from 1 to 9 (3x3, they would be 1 to 16 in a 4x4).
There is a sum that all of the below add to.
-Each row adds up to that number
-Each col adds to that number
-Both Diagonals add to that number
Have the program print out whether or not it is a magic square.
Test
1 1 1 1 1 1 1 1 1 (false)
1 2 3 4 5 6 7 8 9 (false)
8 1 6 3 5 7 4 9 2 (true)
Part 2:
Fork your program (to save your original) and expand on the program to accept an input from the user to say how many rows/cols your square has before accepting the values in each row/col. Return whether or not the inputted square is a magic square. Attached is a document with test cases for varying sizes.
Due:
Fork this project, and make it work! Don't let the player pick values outside of the range. Don't let them choose a spot that is filled, and lose their turn. Check for the winner after each turn.
Due:
1. Create a program that will create a 2D array that holds the values matching a phone keypad. If you were to get both the letters and the numbers in there, what type should the array be? Print out the Array.
2. Create a program that will create a 3x3 array of random integers between 1 and 100. Print out the array. Then, write a method that will calculate the sum of a row of a 2D array. Call it rowSum (int [] [] arr, int row) where arr is the 2D array, and row is the # of the row it is adding up. Then create colSum(int [] [] arr, int col) with the same idea. Have your program print out each row sum and each col sum with the appropriate labels. To ensure it works, change your array to a 4x4 and run it again.
2. Create a program that will create a 3x3 array of random integers between 1 and 100. Print out the array. Then, write a method that will calculate the sum of a row of a 2D array. Call it rowSum (int [] [] arr, int row) where arr is the 2D array, and row is the # of the row it is adding up. Then create colSum(int [] [] arr, int col) with the same idea. Have your program print out each row sum and each col sum with the appropriate labels. To ensure it works, change your array to a 4x4 and run it again.
Due:
Finish Array 1 - 7 more (27 total)
Logic 1 - 5 more (15 total)
Should have Warm Up 1 and Warm Up 2 completed. If you do not, finish those as well.
Logic 1 - 5 more (15 total)
Should have Warm Up 1 and Warm Up 2 completed. If you do not, finish those as well.
Due:
Use the resources to create a program that has each of these sorting algorithms (bubble, insert, selection) take a random array and sort it. Do not just copy and paste the code (I know you can do that). Try to write the code based on the videos and the animations. Test test test your algorithms.
This is a participation grade. Share what you have and I can give feedback if you have questions. Not in realtime, but I will get back to you. When we get back we will have a little activity on recognizing the code for each of these algorithms - the AP test hasn't asked to write a sorting algorithm, just to debug a broken one or recognize what one does given particular info. Big O notation will be the first 2 levels of college programming, but you should be aware of it.
This is a participation grade. Share what you have and I can give feedback if you have questions. Not in realtime, but I will get back to you. When we get back we will have a little activity on recognizing the code for each of these algorithms - the AP test hasn't asked to write a sorting algorithm, just to debug a broken one or recognize what one does given particular info. Big O notation will be the first 2 levels of college programming, but you should be aware of it.
Due:
Fill out the Google Form based on the Google Doc info.
Identify the sorting algorithms as Bubble, Insert or Selection. Also identify if the resulting array will be non-increasing or non-decreasing.
Identify the other random methods based on what they do. Be as specific as you can; they are methods that would help search (linear vs binary search) or analyze or change arrays in a particular manner.
Identify the sorting algorithms as Bubble, Insert or Selection. Also identify if the resulting array will be non-increasing or non-decreasing.
Identify the other random methods based on what they do. Be as specific as you can; they are methods that would help search (linear vs binary search) or analyze or change arrays in a particular manner.
Due:
Create a program in which the main method contains:
an unsorted array
a sorted array
an unsorted ArrayList
a sorted ArrayList
print all collections
run appropriate methods on the collections (unsorted array - sequential find, sorted ArrayList - binary find, etc.)
Other Methods needed:
print - two versions, one takes the array as a parameter and the other is an ArrayList as a parameter
searching methods that return the location in which you found the value x, or -1 if you did not find it.
findSequentialArray(int [] arr, int x)
findBinaryArray(int [] arr, int x)
findSequentialArrayList(ArrayList arr, int x)
findBinaryArrayList(ArrayList arr, int x)
an unsorted array
a sorted array
an unsorted ArrayList
a sorted ArrayList
print all collections
run appropriate methods on the collections (unsorted array - sequential find, sorted ArrayList - binary find, etc.)
Other Methods needed:
print - two versions, one takes the array as a parameter and the other is an ArrayList as a parameter
searching methods that return the location in which you found the value x, or -1 if you did not find it.
findSequentialArray(int [] arr, int x)
findBinaryArray(int [] arr, int x)
findSequentialArrayList(ArrayList
findBinaryArrayList(ArrayList
Due:
5 more in Logic 1 (10 total)
5 more in Array 1 (20 total)
5 more in String 1 (10 total)
5 more in Array 1 (20 total)
5 more in String 1 (10 total)
Due:
Create a program that will contain the two following methods dealing with ArrayLists.
For simplicity, use
Collections.sort(yourArrayListThatNeedsToBeSorted);
And adjust the import line to java.util.*;
In order to ensure the ArrayList you are passing will be sorted.
For simplicity, use
Collections.sort(yourArrayListThatNeedsToBeSorted);
And adjust the import line to java.util.*;
In order to ensure the ArrayList you are passing will be sorted.
Due:
Complete 5 in Logic 1
Complete 5 in Strings 1
Complete 5 more in Array 1 (15 total)
Complete 5 in Strings 1
Complete 5 more in Array 1 (15 total)
Due:
Use the attached as a starting point.
a) findValue - takes an array and an integer as a parameter, and returns if the value is found within the array (true/false)
b) reverseArray - takes an array as a parameter, and returns the reverse of the array EX: {1,2,3} --> {3,2,1}
c) fillArray - takes two integers as parameters, the first determines how many values are within the array, and the second determines the
max value it will be filled with. An array is then filled with random numbers from 1 to the max value and then returned.
d) isSorted - takes an array as a parameter and returns whether or not it is in non-decreasing order.
a) findValue - takes an array and an integer as a parameter, and returns if the value is found within the array (true/false)
b) reverseArray - takes an array as a parameter, and returns the reverse of the array EX: {1,2,3} --> {3,2,1}
c) fillArray - takes two integers as parameters, the first determines how many values are within the array, and the second determines the
max value it will be filled with. An array is then filled with random numbers from 1 to the max value and then returned.
d) isSorted - takes an array as a parameter and returns whether or not it is in non-decreasing order.
Due:
Build a program that has the following methods using a static array of Strings. Create the following methods that don't take parameters but access the static array.
countVowels - analyzes at each String and counts how many vowels there are (aeiou). Returns the count
countLetters - counts the length of each String and returns the sum of the lengths
find(String letter) - counts and returns the number of times the String letter appears in all of the words. Precondition: Letter will have length 1.
countVowels - analyzes at each String and counts how many vowels there are (aeiou). Returns the count
countLetters - counts the length of each String and returns the sum of the lengths
find(String letter) - counts and returns the number of times the String letter appears in all of the words. Precondition: Letter will have length 1.
Due:
WarmUp 1 - You should have 12 completed so far. To earn all 5 points, you must have 24 completed by Monday (12 new ones).
Due:
Today's project you will create is similar to yesterdays but involves Strings.
A) Create a method that takes a String input and returns the String without any vowels (AEIOU). - input: "banana", returns "bnn"
B) Create a method that takes a String input and returns the String with it's reverse concated at the end - input: "computer", returns "computerretupmoc"
C) Create a method that takes a String input and follows the attached image's rules about making the word plural, and returns the plural version of the word. Know that there are at least 9 more rules, plus exceptions to these rules, I am just looking for these two.
D) Create a method that takes two Strings and zipper joins them into one word. The method will return that new word. - input "Cranford" "Banana" returns "CBraannafnoard". Note that words may not be the same length, but they will at least have a length of 1.
E) Create a main method that takes user input to test these methods. Make a menu to ask the user for input as to which method to do each time the program is run.
A) Create a method that takes a String input and returns the String without any vowels (AEIOU). - input: "banana", returns "bnn"
B) Create a method that takes a String input and returns the String with it's reverse concated at the end - input: "computer", returns "computerretupmoc"
C) Create a method that takes a String input and follows the attached image's rules about making the word plural, and returns the plural version of the word. Know that there are at least 9 more rules, plus exceptions to these rules, I am just looking for these two.
D) Create a method that takes two Strings and zipper joins them into one word. The method will return that new word. - input "Cranford" "Banana" returns "CBraannafnoard". Note that words may not be the same length, but they will at least have a length of 1.
E) Create a main method that takes user input to test these methods. Make a menu to ask the user for input as to which method to do each time the program is run.
Due:
Log onto AP Classroom and individually complete the
Unit 4 Progress Check: MCQ
Unit 4 Progress Check: MCQ
Due:
Review Student Guide
Have your MagPie respond to "I want ____ " "I like ____ " and "I ___ you " where the blanks are used in the response from the program.
Add one more response where part of the user's statement is used in the response.
Add 2 more non-committals (10 total).
Have your MagPie respond to "I want ____ " "I like ____ " and "I ___ you " where the blanks are used in the response from the program.
Add one more response where part of the user's statement is used in the response.
Add 2 more non-committals (10 total).
Due:
Adjust all indexOfs to findKeyword
Add more keyword decisions until you have at least 10 total (plus the empty String one)
Add more non-Committals until you have have at least 8 total
Add more keyword decisions until you have at least 10 total (plus the empty String one)
Add more non-Committals until you have have at least 8 total
Due:
Pets
Teacher
Empty Message (Trim)
2 more non-committal
3 more keywords (single words or groups of words)
Teacher
Empty Message (Trim)
2 more non-committal
3 more keywords (single words or groups of words)
Due:
Open this link, and create a fork of it. Send me a link to that new project here. The Student Guide is attached. The specific assignments will be posted on classroom, this one is just making sure that you can get the program into your replit and run it.
Due:
Complete the following programs. For the month program, make sure you are only using a decision to check for proper input, no other decision is allowed. Remember, this is a String assignment.
Due:
Once you complete your previous assignments (dice, ap classroom), this is your next lab on decisions. Read carefully. This is a college level lab assignment.
Due:
Create a program that rolls 2 6 sided dice (random number between 1 and 6). Then the program should output the sum of the two rolls and identify if the numbers add up to 7 ("Craps") to 2 ("Snake Eyes") or 12 ("Boxcars"). If none of those special rolls occur, check for doubles (two rolls are the same) and output "Doubles" or "Not Doubles".
Due:
Log into AP Classroom, and check out the videos posted. The questions are designed to get you more familiar with the type of questions that will be on the AP test, so this first one that I am giving you is for your benefit. I will only be grading you on completion, and will answer any questions you might have on Monday.
Due:
1. Create a program that asks for the user's name and grade, and outputs the information as "Hello ______, welcome to the __th grade."
2. Create a program that asks the user for an integer temperature in F, and outputs its correlating degree in C. Make sure it is accurate to the nearest hundredth.
3. Create a program that asks the user for the distance to their goal and the amount of time they have to get there. It would then calculate the average speed you must go in order to get there to the nearest MPH. Remind them that it doesn't account for lights & traffic.
2. Create a program that asks the user for an integer temperature in F, and outputs its correlating degree in C. Make sure it is accurate to the nearest hundredth.
3. Create a program that asks the user for the distance to their goal and the amount of time they have to get there. It would then calculate the average speed you must go in order to get there to the nearest MPH. Remind them that it doesn't account for lights & traffic.
Due:
Create a program that stores 2 int variables, and then prints the sum, product, quotient, difference and remainder. Make sure to label which is which and what the initial variable values are.
Due:
Sign up using the code: EQ4QDL
AP exam registration will be open Wednesday, September 15 through Wednesday, October 27, 2021 for $96 per exam. It is a 2 step process to register and step 1 is due by the end of the first full week of school.
1. Students must join the AP class through MyAP and enter the join code for your class.
2. Students then pay for exams through AP Test Service. We will discuss this in class before the registration opens. It is strongly recommended but not required.
AP exam registration will be open Wednesday, September 15 through Wednesday, October 27, 2021 for $96 per exam. It is a 2 step process to register and step 1 is due by the end of the first full week of school.
1. Students must join the AP class through MyAP and enter the join code for your class.
2. Students then pay for exams through AP Test Service. We will discuss this in class before the registration opens. It is strongly recommended but not required.