Question: Java Operators 2 Exercise 1. Create a new Java class called JavaOperators2. 2. In the main method, create two integer variables called x and y,

 Java Operators 2 Exercise 1. Create a new Java class called

Java Operators 2 Exercise 1. Create a new Java class called "JavaOperators2". 2. In the main method, create two integer variables called "x" and "y", and set their values to 5 and 3 , respectively. 3. Use the addition operator to add x and y, and assign the result to a new variable called "sum". 4. Use the subtraction operator to subtract y from x, and assign the result to a new variable called "difference". 5. Use the multiplication operator to multiply x and y, and assign the result to a new variable called "product". 6. Use the division operator to divide x by y, and assign the result to a new variable called "quotient". 7. Use the modulus operator to calculate the remainder when x is divided by y, and assign the result to a new variable called "remainder". 8. Use the increment operator to increase the value of x by 1 . 9. Use the decrement operator to decrease the value of y by 1. 10. Use the logical AND operator to compare whether x is greater than y AND whether y is less than x, and assign the result to a new variable called "resul 11. Print out the values of all the variables you created in steps 3-10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!