<p>A lot of those errors sound very similar to mine - I’d be very curious to know as well!</p>
<p>for the mc about Computer comp did you guys put Computer.getBrand(comp) will compile without error or what
also again
what did you guys put for num 2
it was asking which would evaluate true
I avar < 50 || avar >90
II avar < 50 && avar >90
III avar</=50 && 90<avar</p>
<p>and for (x || y) && x did it evaluate to x?</p>
<p>
</p>
<p>I’m pretty sure it’s only 1. < 50 & > 90 is impossible, and 90<avar is the same thing</p>
<p>yeah i chose that too
what did you choose for the other two questions i mentioned</p>
<p>@redgreen</p>
<p>You would need to override two methods. If you used removeSelfFromGrid() in getMoveLocation() , you violate the post-condition of changing the state of the actors.</p>
<p>You can and you should have returned null in getMoveLocation() if locs.size()==0. This was stated in the directions.</p>
<p>Returning null in getMoveLocation() does not mean that the Critter is removed from the grid. If you remember, it goes getMoveLocation()->selectMoveLocation()->makeMove(). An arrayList equal to null simply means selectMoveLocation() returns the actor’s current location. The actor’s current location is valid and thus does not remove itself from the grid. (I messed up this part too D:</p>
<p>@mathguy
That doesn’t make sense. get methods don’t take parameters.</p>
<p>oh true wow so careless
@nidget what did u get for the one with sqrt and ==
was it false due to the floating point imprecision?
and for (x || y) && x did it evaluate to x?</p>
<p>Correct me if I’m wrong, but I’m pretty sure that because getEmptyLocations() was a static method, you would call it with GridWorldUtilties.getEmptyLocations(), instead of with an instance of GridWorldUtilies, right?</p>
<p>Yea you’re right. I have like no experience with static methods and lost half a point on that though :(</p>
<p>According to many websites apparently you can call a static method within an instance of a class because the object has access to all the static and regular methods in the class. Although apparently this isn’t good programming practice due to polymorphism rules pertaining to static methods that don’t apply here. Not sure if the graders know this and we’ll get credit though :(</p>
<p>oh what did you guys write for the critter part of the gridworld question, and the method of updating downloads, i wasted a lot of time changing my code on these parts</p>
<p>@mathguy69 I didn’t understand why I had to use the first method created for the DownloadInfo thing. I think I ended up using for each String loop to go thru the parameter and then I for-eached thru the download list and got the DownloadInfo string. If the name was the same I incremented the score, if not I added a new Downloadinfo with the new string.</p>
<p>yeah part a was so unrelated, oh for the tokenpass question what did you write as your constructor, i felt mine was too short, and the method for distribute token method</p>
<p>Part a is not unrelated; if you didn’t use the program you wrote in part a you’ll probably lose points.</p>
<p>You had to increment the song if it already existed or add it to the end of the list if it didn’t, so you’d have a for loop that checks if the song exists (through the method you did in part a) and increments it if it does, or appends the song to the end if the method returns null.</p>
<p>that 2d array FRQ made me do a double take since it didn’t go in the usual order (from left to right). Good thing I had time to figure it out and fix it!</p>
<p>wow i failed this so hard, what did u guys do for question 4 on the part to average. I must have gotten at least one part of a question right.</p>
<p>also what did u guys choose for the mc question that asked what is returned by a call to dosomething. It was about index of vals or something like that.</p>
<p>I used a for loop to find the values and add them to a variable. Inside the for loop I incremented another variable to keep count of how many values were added. And then I just returned the total / numVal. did you make total a double variable?</p>
<p>yeah, why weren’t we suppose to?</p>
<p>oh no, just double checking. I almost forgot to since I instinctively write int</p>