This site requires JavaScript, please enable it in your browser!
Greenfoot back
SOUPNAZI
SOUPNAZI wrote ...

2015/5/11

why did I get this answer wrong?

SOUPNAZI SOUPNAZI

2015/5/11

#
I answered this question as A & got it wrong but I dont understand why. It has the int for X & the int for Y so what other possible answer could be a correct option? "Which one of the following statements does NOT have a syntax error?" The answer options were A) setLocation(400,200); B) setLocation (300); C) setLocation(34;56); D) setLocation(getLocation()+2); E) setLocation(34,50,60);
lordhershey lordhershey

2015/5/11

#
Only 1 of those is a syntax Error C - it is not parse able. The other expressions can be parsed, but the errors you would get for D and E would not by syntax errors, they would be errors like Method not define/found or something like that. Was this question one of those that said check all that do not contain syntax errors?
SOUPNAZI SOUPNAZI

2015/5/11

#
lordhershey wrote...
Only 1 of those is a syntax Error C - it is not parse able. The other expressions can be parsed, but the errors you would get for D and E would not by syntax errors, they would be errors like Method not define/found or something like that. Was this question one of those that said check all that do not contain syntax errors?
No, it only allowed me to answer with 1 option
lordhershey lordhershey

2015/5/11

#
Well, then that makes no sense - if you are looking for the error free statement it would have to be the first one and the assumption would have to be that this was being called within a class that extended the Actor class. Did the instructor offer an explanation or did they give the 'correct' answer?
SOUPNAZI SOUPNAZI

2015/5/11

#
lordhershey wrote...
Well, then that makes no sense - if you are looking for the error free statement it would have to be the first one and the assumption would have to be that this was being called within a class that extended the Actor class. Did the instructor offer an explanation or did they give the 'correct' answer?
No, it was an online test but I emailed the instructor to contest the decision
danpost danpost

2015/5/11

#
(C) is the only one that cannot be a legal statement -- ever. All the others CAN be legal statements if methods with the appropriate parameters were available. If 'C' is the correct answer then the question should read as follows: "Which one of the following statements has a syntax error?"
SOUPNAZI SOUPNAZI

2015/5/12

#
lordhershey wrote...
Well, then that makes no sense - if you are looking for the error free statement it would have to be the first one and the assumption would have to be that this was being called within a class that extended the Actor class. Did the instructor offer an explanation or did they give the 'correct' answer?
AND
danpost wrote...
(C) is the only one that cannot be a legal statement -- ever. All the others CAN be legal statements if methods with the appropriate parameters were available. If 'C' is the correct answer then the question should read as follows: "Which one of the following statements has a syntax error?"
The instructor stated it was a system error and corrected it, stating my input was correct
lordhershey lordhershey

2015/5/12

#
Even with the fix the test question is still wrong. :/
You need to login to post a reply.