Question: What does the Modulus % Operator do, give example? 2.Declare an integer number myNumber and assign the value 15 to it. 3.Write the Java

What does the Modulus % Operator do, give example? 2.Declare an integer

What does the Modulus % Operator do, give example? 2.Declare an integer number "myNumber" and assign the value 15 to it. 3.Write the Java code to check if the integer "myNumber" is Divisible by 3. 4.Write the Java code to check if the integer "myNumber" is Divisible by 5. 5.Write Java code to check if the integer "myNumber" is Divisible by 3 and 5. 6.Write the Java code to check if the integer "myNumber" is Odd or Even. 7.Write the Java code to check if the user entered the correct Valid Choice. (Valid Choices are 1, 2, 3 and 4 only) 8.Write the Java code to use Switch..... Case to check if the choice entered is 1, then call the method "printDivisibleBy3". 9.Write the Java code to code in Java the method "printDivisibleBy3" to print the Numbers from 0 thru 100 Divisible by3. 10.What is Try....Catch and Finally used for, give an example? 11.Declare a static final variable called "MILES_PER_KILOMETER" to hold the constant value 0.621. 12. Write the Java code to use While statement and Try... Catch and Finally while the User enters Invalid Data (Not Numbers). 13. Write the Java code to use JOptionPane.showMessageDialog() method to display a Dialog box with the message "Hello Oakton College Students". 15. What will happen if you divide an Integer Number by Zero?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 Modulus Operator The modulus operator in Java denoted as calculates the remainder when one number ... View full answer

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 Programming Questions!