*** Official AP Computer Science A Thread 2014-2015 ***

@unavailable I don’t know about the ‘private’ issue. The AP Course Description says that all instance variables are supposed to be private. If I’m reading it correctly, not using ‘private’ was a deduction on a problem in 2014. It’s at most a one-point deduction.

I made an if and else if statement for every situation. Like if the letter doesn’t exist put * everywhere

@jkhuggins your probably right. I will probably loose a point there and a point in #4b for not making any of my instance variables private. Thanks for the help anyway.

I was just wondering:
Aren’t there a bunch of ways to do Range? Obviously you need some sort of private instance variable, a constructor, and a contains method…but there are an array (lol) of ways to do that…

@sb98park @CounterStruck In general, there are always lots of ways to complete the problem correctly. As long the solution solves the problem, and the solution isn’t explicitly excluded by the description, then it’s eligible for full credit.

I didn’t even use implementing classes and such for #4. But I believe all my coding works perfectly. What would that be?

For #4 c, if I created an int variable and made a for loop every time it is greater than one. And lastly, I made an if statement saying if count(variable) is greater than or equal to 1 return true; return false; would that work?

@sb98park Not sure how to interpret what you’ve said, since part (a) requires you to define an interface and part (b) requires you to define a class. I expect that might be 2-3 points of deductions, but I can’t be sure.

Also … not sure what you’re trying to count there. If you’re counting the number of items in the list which match the target item and return “true” if that count is >=1 … yes, that sounds fine.

Did you have to create a 2d array for number 3? I just used the variable for array list

For question 2 about a hidden word, how many points would be deducted if the variables weren’t declared private and I set a substring equal to “+” or “*” instead of adding them to a new string (I did create a new string, however, that was equal to the actual word).

Do you get points off for doing the contains method in part 4 not as an if statement but like this:
public boolean contains(int num)
{
boolean temp = false;
for(int i = min; i <= max; i++)
{
if(i == num)
{
temp = true;
}
}
return temp;
}

I just realized i could have answered it in one line, but it still works so will points get deducted?

See
http://talk.collegeconfidential.com/mathematics-computer-science/1775137-apcs-2015-frqs-proposed-solutions.html?new=1
for answers.

@sb98park No, you don’t need to create a 2D array. My solution didn’t.

@AlphaDragon Private declaration is probably a 1 point deduction. Problems in constructing the proper result string like you described are probably a 1 point deduction (assuming the logic surrounding it is good).

I know the answer, but mine still solves the problem a different and somewhat weird way, i was wondering if i get points deducted if it isn’t the way collegeboard thought the answer was.

@darkpoison Your contains() looks fine. Yes, it’s inefficient, but it still works. In general the rule is: if it works, it’s eligible for credit (unless you violated some explicit direction in the writeup).

O, thanks @jkhuggins

I literally did return Entries[row][col]; that’s probably wrong

Here’s a set of solutions, produced by an APCS textbook author: http://www.skylit.com/beprepared/fr2015.html

For the last question, I basically rewrote the contains method when I could have just called the method. Is it +0 or is it actually -1?

@rdeng2614 (I’m assuming you’re talking about part C) Not calling the contains() method will cost you at least 1 point. All you know about groupList is that it’s a list of NumberGroups, not a list of Ranges … so you can’t assume that the NumberGroup has a min and max.