6/4/2019
CS 1102 - AY2019-T4: Discussion Assignment
1/38
Home
►
My courses
►
CS 1102 - AY2019-T4
►
11 April - 17 April
►
Discussion Forum Unit 1
►
Discussion Assignment
Subscribe
HOME
CONTACT US
RESOURCES
LINKS
FACULTY
MY COURSES
MENU
Search forums
Discussion Assignment
by Eric Goh (Instructor) - Wednesday, 10 April 2019, 7:00 PM
Describe the function of each of the following Java operators:
++
&&
!=
%=
10 words
Permalink | Reply
Re: Discussion Assignment

** Subscribe** to view the full document.

6/4/2019
CS 1102 - AY2019-T4: Discussion Assignment
2/38
by Michael Andersen - Saturday, 13 April 2019, 1:54 AM
++
is the increment operator is represents adding 1 to a variable. For example, z =
z + 1 is the same as z++. The latter is much shorter and convenient to use.
&&
represents AND in Java and is a boolean operator. So if you wanted to test
whether the value of two things are true (e.g., a > 10 && b > 100), then you could
use &&. If both are true (i.e., if both a > 10 and b > 100 are true), and only if both
are true, then the expression is true. If one or both are false, then the expression
is false.
!=
is the opposite of == and means "is not equal to." It is also a boolean operator.
For example, the expression a != b is true if a is not equal to be, and is false if a is
equal to b.
%=
is a type of assignment operator. A %= B is the same as A = A % B. But then
what is %? The % operator is used for computing the remainder when one
number is divided by another. For example, 10 % 3 = 1 because the remainder of
10/3 is 1.
187 words
Permalink | Show parent | Reply
Re: Discussion Assignment
by Phong Duong - Monday, 15 April 2019, 6:18 PM
Good work, Michael. Your explanation is clear and understandable. Keep going.
11 words
Permalink | Show parent | Reply
Re: Discussion Assignment
by Dalton Overlin - Tuesday, 16 April 2019, 6:07 AM
Michael.
Your response is concise, and fully answers the question of what all four of
these Java operators do. I also like your description of the modulus operator, it
makes it simple to understand what this operator does. As a matter of fact this
operator is one of my favorites, because its so interesting to how it works which
makes me wonder all the ways it can be used to solve complex problems.
73 words
Permalink | Show parent | Reply
Re: Discussion Assignment

6/4/2019
CS 1102 - AY2019-T4: Discussion Assignment
3/38
by Jason Campbell - Tuesday, 16 April 2019, 6:16 AM
Nice! Your explanation looks nicer than mine haha
8 words
Permalink | Show parent | Reply
Re: Discussion Assignment
by Mark Rajour Nfon - Wednesday, 17 April 2019, 7:46 AM
Hello Michael
Great post mate, your answer was short, concise, simple and straight to point. I have
learned from your work regarding the functions of the various operators used in java.
Indeed you have clearly understood what the various operators used in java are as
well as their functions. Thanks for sharing your ideas with us mate.

** Subscribe** to view the full document.

- Fall '18