### Morning Session II : Teaching the Course [2D array using Picture Lab]

#### Picture Lab Sample Student Starter Code

• Picture class
• beach.jpg
• ...see page 251 for details about setting up "images" folder and leftArrow.gif & rightArrow.gif files. ...see page 255 for Exercises
• PictureTester class...for testing 2D matrix manipulation, forEach loops ...from page 262
• Exercises in Activity 5
1. grayscale: gr=(r+g+b)/3. Use pixelObj.setColor(new Color(gr , gr , gr))
2. sepia definition is (112, 66, 20), watch for out-of-bounds conditions (255).
r = gray*112/255
g = gray*66/255
b = gray*20/255
• Use another Picture Lab Activity (or Exercise in Activity 5)
• Write a class to complete your selected Activity/Exercise

### Afternoon Session I : Assessing Student Progress & Understanding [Previous Exams]

#### 2021 Free Response Analysis

 2021 Specification Notes Classes and Methods FRQ 1: Methods & Control Structures Write two methods that call other specified methods.   int scoreGuess(String guess) returns a score based on rules that require a call to substring()   String findBetterGuess(String g1, String g2) returns the parameter which has the higher score (or first if tied) based on calls to the scoreGuess() method String.equals() must be used WordMatch WordMatch(String word) int scoreGuess(String guess)   String findBetterGuess(String g1, String g2) FRQ 2 : Class Design Write a class, constructor, 2 methods, and two field variable to implement a restaurant seating which combines 2 SingleTables objects into a CombinedTable with appropriate checks for seating size and desireable view specifications. Declare & initialize private field variable.   Declare parameters and assign to field variable.   check if CombinedTable can seat all from SingleTable   calculate desirability   Cast int average properly to double. SingleTable int getNumSeats() int getHeight() doulbe getViewQuality() setViewQuality(double)   CombinedTable CombinedTable(SingleTable, SingleTable) boolean canSeat(int) double getDesirability() FRQ 3 : array or ArrayList Given an ArrayList of members, add to the list an array of names and graduation year. Also remove any that have graduated and are not in good standing.   void addMembers(String[] names, int gradYear) adds new club members to memberList according to rules.   ArrayList removeMembers(int year) returns a list of students who have graduated and are in good standing. Also removes from the memberList all who have graduated Correct instantiation : constructor call with parameters. Removal from ArrayList while iterating. MemberInfo MemberInfo(String, int, boolean) int getGradYear() boolean inGoodStanding()   ClubMembers addMembers(String[], int) ArrayList removeMembers(int) FRQ 4 : 2D array Given an ArrayResizer class with a on-specified 2D array of ints as well as a method that identifies the number of non-zero rows, write a static method to identify if any row contains only non-zero elements. Write a 2nd static method that returns a copy of the 2D array of ints with rows that contain only non-zero rows.     static int numNonZeroRows( int[][] array2D) will return the number of rows that have no zeros as elements. Use of static Correctly instantiate the size of a 2D array of ints ArrayResizer static boolean isNonZeroRow(int[][] array2D, int r) static int numNonZeroRows(int[][] array2D) static int[][] resize(int [][] array2D)

#### 2020 Free Response Analysis

 2020 Specification Notes Classes and Methods Covid Year testing was all online : considered highly confidential by College BOard numerous test questions aligned to new CED available in AP Classroom Question bank

#### 2019 Free Response Analysis

 2019 Specification Notes Classes and Methods APCalendar   FRQ 1: Methods & Control Structures Write two methods that call other specified methods.   numberOfLeapYears() returns the number of leap years between two given years.   dayOfWeek() returns the value of the day of the week with Sunday=0,...,Saturday=6 static used APCalendar boolean isLeapYear(int y) int numberOfLeapYears(int y1, int y2) int firstDayOfYear(int y) int dayOfYear(int m, int d, int y) int dayOfWeek(int m, int d, int y) StepTracker   FRQ 2 : Class Design Write a class, constructor, 3 methods, and a field variable to implement a fitness tracking system. Declare & initialize private field variable.   Declare parameters and assign to field variable.   Return updated field variable   Cast int to double. StepTracker StepTracker(int d) void addDailySteps(int s) int activeDays() double averageSteps() Delimiter   FRQ 3 : array or ArrayList Given a Delimiters class with two String field variables, write two methods.   ArrayList getDelimitersList(String[] t) returns a list of delimiters from an array of tokens in the order they appear.   boolean isBalanced(ArrayList d) returns whether or not the opening and closing delimiters are balanced. Assumes open and close delimiters are distinct Strings.   Use of String.equals(String o)   Local variable as accumulator for balancing equal number and sequencing of open & close delimters..   Recursive solution possible but few were correct. Delimiters private String openDel private String closeDel public Delimeters(String o, String c)   ArrayList getDelimitersList(String[] t)   boolean isBalanced(ArrayList d) LightBoard   FRQ 4 : 2D array Given a LightBoard class with a 2D array of on/off lights, write a constructor and method to initialize and determine if a light is on or off.   LightBoard(int numR, int numC) will initialize a 2D array of booleans with a 40% probability of any light being on.   boolean evaluateLight(int r, int c) will return whehter a specified light is on (return true) or off. Use of Math.random() and assignment/cast of double to boolean.   Rules include use of modulus operator to determine if column is even or a multple of 3.   Use of an accumulator for number of lights on in 2D array. LightBoard private boolean[][] lights LightBoard(int numR, int numC) boolean evaluateLight(int r, int c)

6.18 2.98 9

4.90 3.53 9

5.56 3.54 9

4.82 3.3.8 9

Exam Score

% At

18583 26.7

15275 21.9

14660 21.0

8.320 11.9

12847 18.4

69685

44129 67.8

3.18

1.45

5.34 3.14 9

4.38 3.53 9

5.11 3.61 9

4.75 3.62 9

Exam Score

% At

16105 24.7

13802 21.2

14222 21.8

7738 11.9

13266 20.4

65133

44129 67.8

3.18

1.45

4.10 3.17 9

5.86 3.54 9

3.84 3.31 9

4.75 3.46 9

Exam Score

% At

14623 24.2

12650 20.9

13271 21.9

6970 11.5

13005 21.5

60519

40544

3.15 67.0

1.46

3.42 2.97 9

2.94 2.73 9

2.59 2.97 9

3.29 3.06 9

Exam Score

% At

12055 20.8

11900 20.5

13386 23.1

7215 12.5

13381 23.1

57937

37937

3.04 64.5

1.44

5.05 3.36 9

4.41 3.4 9

3.05 3.4 9

3.99 3.19 9

Exam Score

% At

11963 24.4

12061 24.6

7470 15.2

3529 7.2

13971 28.5

48994

31494

3.09 64.3

1.56

Exam Score

% At

### Afternoon Session II : Assessing Student Progress & Understanding [Write MC Question]

#### Participant Activity [Sample Questions]

• Focus on specific topics and "newer-style" questions :
• Questions that can easily be modified (i.e. create-your-own-test): 2, 3, 7, 11, 15
• Write one MC Question that models:
• Composition (aka "has a")
• Inheritance (aka "is a")
• String, Math, or ArrayList API