<p>What kind of penalty would the following error cause in my for loop (for the 2d-array question)</p>
<p>for (int i = 0; i < array[].length; i++)</p>
<p>instead of</p>
<p>for (int i = 0; i <array[NUM].length; i++)</p>
<p>What kind of penalty would the following error cause in my for loop (for the 2d-array question)</p>
<p>for (int i = 0; i < array[].length; i++)</p>
<p>instead of</p>
<p>for (int i = 0; i <array[NUM].length; i++)</p>
<p>that’s what i thought; using the add method will just “add” the object to the list, which will increase the size of the list (not supposed to)</p>
<p>I ought to repeat my standard disclaimer: I speak for myself only here, not the College Board. I’m just offering my opinions.</p>
<p>@Battlebrick: sorry. But that’s what it says in both the Java API and in the APCS Quick Reference. You might want to (gently) point that out to your instructor.</p>
<p>@zhulagirlz: There’s no getNumRows/getNumCols in the GrayImage problem, which is just a 2D-array problem. “.length” is the right way to do it. For the other problems … most readers have quite a bit of patience, and want to give you a fair reading. I wouldn’t try to deliberately write weird code, of course. But don’t worry … you’ll get a fair reading.</p>
<p>@leonz1332: I’m guessing that’d be a 1 point error. Most loop problem rubrics have a point for correctly determining the loop bounds; that would be the natural place to take the deduction.</p>
<p>For the RetroBug I implemented a constructor that took a color as a parameter and called the super(Color col) constructor. I thought that if there was a constructor in the super class it made sense to implement it in the subclass. In hindsight, this seems unnecessary but do you guys think I would lose points for that?</p>
<p>Crap what if I did not use the constants for Gray scale? I used numbers…</p>
<p>Okay, guys, for the retrobug, what if I initialized the field variables in the act method instead of in a constructor? I felt like actually writing a constructor was unnecessary, and I did not…</p>
<p>@steve1sterling: Generally, unnecessary code isn’t a problem. As long as it doesn’t screw up anything else, and it doesn’t rewrite calls provided to you, it’s “no harm, no foul”.</p>
<p>@ZeldaMaster123: I’m not completely sure, but usually the rule is “if it works, it’s fine”. I think using the literal values will be fine.</p>
<p>so is making a retrobug constructer worth a lot of points? if the variables were still initialized properly, does it matter?</p>
<p>I don’t think having or not having a constructor will be the issue. The real issue will be whether or not the solution works. If your solution works and it didn’t have a constructor, then it works and it should be eligible for full credit.</p>
<p>Any idea how many points will be deducted if I wrote (for the last question):
if(row+2<=pixelValues.length && col+2<=pixelValues*.length)</p>
<p>instead of:
if(row+2<pixelValues.length && col+2<pixelValues*.length)</p>
<p>My code results in an ArrayIndexOutOfBounds exception, but if the equals symbols were omitted then my code would meet the program specifications for 4b perfectly. It is intended to check if there is a pixel at position (row+2, col+2).</p>
<p>Sounds like a full point deduction to me …</p>
<p>Jkhuggins, how would you grade Griworld out of 9 pts… And what do you think a 5 would be like? 60/80? Also, how many points reduction is it for accidentally say that 1B. is swap using a temp instead of climbList.add… I mistakenly did that lol</p>
<p>I don’t have a good idea what the GridWorld rubric will look like; I don’t have as much experience with those problems. I also don’t know how scores translate into grades; that changes from year to year. I’m not sure what your third question is …</p>
<p>@JKHuggins, I have a problem with understanding how to answer FRQ question 1B. The question asks you to create a method that adds a new ClimbInfo into an araylist and organize the arraylist by alphabetical order. What I did was this:</p>
<p>Add it to the arraylist first, organize the arraylist.</p>
<p>What other people did was:
Create a new object. Search the arraylist with a for loop and added the object to the appropriate position. This wouldn’t work, since the arraylist will originally have a length of 0.</p>
<p>Based on your interpretation of the question, would adding the object first, then organizing the list be wrong? If so, how many points do you think will be deducted?</p>
<p>@bryster126, your approach is sound. As long as your reorganization of the arraylist works correctly (i.e. eventually lands the new item into sorted position), your approach would be eligible for full credit.</p>
<p>Basically instead of ordering it using climbList.add, I thought it was an array so I switched position by making a temp to switch two things when one is greater than another (compareTo)</p>
<p>@jkhuggins, if I overrode the moveTo() method instead of act(), how much would be taken off if everything else if ok?</p>
<p>Completely speculating here … I don’t think the choice of the method to override is an issue, as long as the method pre-/post-conditions are still satisfied. But I’m not familiar with the way that GridWorld bug/critter questions have been scored in the past.</p>
<p>Well my reservation is that since you had to remember both direction and location, the moveTo() might not be called if the object is blocked but direction might still change. So act() would have been better, but hoping for lenient grading!</p>
<p>for the horse problem part B, would this work?</p>
<p>public void consolidate()
{
Horse temp;
for(int i=0;i<spaces.length;i++)
{
for(int j=i;j<spaces.length-1;j++)
{
if(spaces[j]==null)
{
temp=spaces[j+1];
spaces[j+1]=spaces[j];
spaces[j]=temp;
}
}
}
}<br>
// This works sort of like a bubble sort, shifting any null elements to the right, so eventually they all end up on the right side. At least I think…</p>