63.3k views
1 vote
Write down the Java expressions equivalent to the statements listed below. a=1.35; 1. Assign the value 1.35 to a variable named a; (SAMPLE ANSWER) __________ 2. Add the values of the variables a and b; __________ 3. Assign to A the remainder when the value of B is divided by 15; ++i OR i++ OR i+=1 OR i=i+1 4. Increment the value of i by 5; (SAMPLE ANSWER) __________ 5. Decrement the value of i by 5; __________ 6. Divide A by 5 and assign result to A; __________ 7. A and B; __________ 8. A is not equal to B; __________ 9. A is greater than or equal to B; __________ 10. A is equal to 5, or a is greater than b;

User Aleation
by
7.4k points

1 Answer

0 votes

the Java expressions equivalent to the statements are:

  1. a=1.35- double a = 1.35;
  2. Add the values of the variables a and b;- a + b
  3. Assign to A the remainder when the value of B is divided by 15;- int A = B % 15;
  4. Increment the value of i by 5;- i += 5;
  5. Decrement the value of i by 5;- i -= 5;
  6. Divide A by 5 and assign result to A;- A /= 5;
  7. A and B;- A & B
  8. A is not equal to B;- A != B
  9. A is greater than or equal to B;- A >= B
  10. A is equal to 5, or a is greater than b;- `A == 5

So, in terms of double a = 1.35, the expression declares a variable named a of type double and assigns it the value 1.35.

In terms of add the values of the variables a and b; a + b, it is one expression that simply adds the values of the variables a and b.

User ChosenJuan
by
7.9k points