Question: Write a method that takes a single argument num, an integer, and prints the number passed in and whether it is even or odd. This

Write a method that takes a single argument num, an integer, and prints the number passed in and whether it is even or odd. This method is named oddEvenChecker, and works as follows:
oddEvenChecker(3); // prints "3 is an odd number" oddEvenChecker(8); // prints "8 is an even number"
To do this exercise, it is helpful to know about the modulo operator, represented in Java by the symbol %. Modulo returns the remainder of the number in the right of it divided by the number to the left it - so for example, the value of the expression 7%3 is 1(because 7 divided by 3 is 2 with a remainder of 1).
Implement another method, multipleOfChecker, that takes two arguments num and base, both integers. It then prints whether or not the first number is a multiple of the second number. For instance:
multipleOfChecker(16,4); // Should print "16 is a multiple of 4" multipleOfChecker(11,3); // Should print "11 is not a multiple of 3"
Add at least 2 additional tests to each method, which are DIFFERENT from the given tests. Test your methods in main using various combinations of inputs to rule out any logical bugs. Add the tests and comments with results to the code before you submit!
Write a method named sqrtSumBucketer, that asks the user to input two doubles. It sums their square roots, and prints a statement based on what bucket the result is in. The possible buckets are "Less than 10", "Between 10 and 20", "Between 20 and 30", and "Greater than 30." Negative numbers should be rejected with the appropriate message printed to the user. To find a square root, use Math.sqrt()(don't forget to import java.lang.Math).
For example:
If user enters 23 and 16, then the output should be
Less than 10
If user enters 2 and 999, then the output should be
Greater than 30

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