Monday, May 24, 2010

Homework Help, Java Programming 1?

Which arithmetic or compaison operation is performed first in the following expressions? I'll give you the answers I put. I just want to know if I'm right.





a. 144 / (6 * 2). multiply (), 6 * 2


b. 25%26lt;57 != false. true==false


c. answerA + answerB * answerC. multiply answerB * answerC


d. 125 / (result * 4). divide 125 by 4


e. true == true != false. do left side of equality operator


f. 5 * 3 % 2 + 7 / 2-7





Problem b is using the equality operator. Here is an example using the equality operator:


10 %26lt; 5 == true


false == true


false


I still don't kwow what to do first.





Problem is e is also equality operator





Problem f uses modular divison. In modular division, you only keep the remainder of the problem.





Any help is appreciated. Thanks.

Homework Help, Java Programming 1?
a. correct


b. How would you evaluate true==false first? You only know the right hand side is false at first. You must evaluate the left hand side first


c. correct


d. could be a java thing, I'm not sure


e. correct


f. I would think the 5*3

floral

No comments:

Post a Comment