Free-response questions
Each question matches one of the four FRQ types on the exam. Write your answer in the editor (or on paper, as you will on exam day), then open the rubric and score yourself. Drafts and scores are saved with your progress.
Q1. Methods and Control Structures
7 pointsWrite two methods (or a constructor and a method). Part A (4 pts) uses loops and/or conditionals and calls methods of the class. Part B (3 pts) calls String methods.
Question 1
Rain Gauge
Part a:public int longestDryStreak(int numDays)Part b: public static String initials(String name)Not scored yetQuestion 1Parking Garage
Part a:public int totalFee(int startHour, int endHour)Part b: public static String formatPlate(String plate)Not scored yetQuestion 1Step Challenge
Part a:public int dayGoalReached(int goal, int numDays)Part b: public static int countWord(String text, String target)Not scored yetQuestion 1Quiz Game
Part a:public int playGame(int maxRounds)Part b: public static String shorten(String code)Not scored yetQ2. Class Design
7 pointsWrite a complete class from a description and a table of example calls: header, private instance variables, constructor, and the required method(s).
Q3. Data Analysis with ArrayList
5 pointsWrite one method that uses, analyzes, and changes data stored in an ArrayList of objects.
Question 3
Playlist Cleanup
public int trimArtist(String artist, int maxSeconds)Not scored yetQuestion 3Temperature Log
public ArrayList<Integer> bigRises(double minRise)Not scored yetQuestion 3Food Truck Orders
public int cancelSmall(String item, int minQty)Not scored yetQuestion 3Inventory Merge
public int mergeDuplicates()Not scored yetQ4. 2D Array
6 pointsWrite one method that uses, analyzes, and changes data stored in a 2D array.
Errors that don't cost points
- Extra code with no side effect, such as a valid precondition check
- Spelling or case mistakes when the meaning is clear
- Local variable not declared (unless the rubric requires it)
- private or public on a local variable
- Missing public on a class or constructor header
- Method header rewritten with different parameter names
- Common math symbols for operators (× ÷ ≤ ≥ ≠)
- [] vs. () vs. <> confusion
- = instead of == and vice versa
- length / size confusion for arrays, Strings, and ArrayLists
- [i,j] instead of [i][j]
- Missing ; or { } when the structure or indentation makes the intent clear
- Missing ( ) on a method call with no parameters, or around if / for / while conditions
When an algorithm point is lost
- Required pieces are left out
- Steps are put together in the wrong order
- Extra code makes the solution wrong (for example, printing output)
- Mixing up array [] and ArrayList .get access when it isn't otherwise assessed
- Changing persistent data, such as a parameter's value
- Returning a value from a void method or constructor
- Rewriting a provided method header with a different number or type of parameters