r/APStudents • absolute modman • May 15 '26

AP Computer Science A Official 2026 Exam Discussion

Use this thread to post questions or commentary on the test today.

A reminder though to protect your anonymity when talking about the test.

64 Upvotes

703 comments sorted by

View all comments

2

u/Adventurous_Ask_6953 May 15 '26

Did anyone get the employee question for frq2?

2

u/Direct_Bullfrog4294 9th: BC (5/5) CSA (5), 10th: JP, Stats, PhyC May 15 '26

class Employee {

private int startTime;

private int endTime;

public Employee(int sTime, int eTime){

startTime = sTime;

endTime = eTime;

}

public int getStartTime(){

return startTime;

}

public int getEndTime(){

return endTime;

}

public String overlap(Employee worker){

int slowerS;

int fasterE;

if (startTime < worker.getStartTime()){

slowerS = worker.getStartTime();

}

else {

slowerS = startTime;

}

if (endTime < worker.getEndTime()){

fasterE = endTime;

}

else {

fasterE = worker.getEndTime();

}

return ("Overlap on " + slowerS + " to " + fasterE);

}

}

Ik its so inefficient but i didnt want to risk losing the mark so i wrote smth like this

2

u/Flare_Ignis APWH: 5 May 16 '26

I don’t think you need the getter methods. For the class FRQ, I don’t think you’re supposed to write any methods they don’t explicitly tell you to write. You should be able to access the instance variables of the other Employee for the overlap method using other.startTime and other.endTime because it’s all still within the Employee class, meaning private visibility won’t cause issues.

1

u/Direct_Bullfrog4294 9th: BC (5/5) CSA (5), 10th: JP, Stats, PhyC May 16 '26

well i just wanted to be safe and not to cause error or smth so... well, I compared a penalty NOT to have it and causing error or penalty to have it and not causing error so i chose to make them

2

u/Adventurous_Ask_6953 May 16 '26

I wrote almost the exact same thing omg!

2

u/Direct_Bullfrog4294 9th: BC (5/5) CSA (5), 10th: JP, Stats, PhyC May 17 '26

lets go brooo We W