Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java please Part 1 1. In this exercise you will write a method that takes a single argument, an integer, and prints the number
In Java please
Part 1 1. In this exercise you will write a method that takes a single argument, an integer, and prints the number passed in and whether or not it is even or odd. This method is named oddEvenChecker, and should work as follows: oddEvenChecker (3); // Should print "3 is an odd number" oddEvenChecker (8); // Should print "8 is an even number is helpful to know about the modulo operator, represented in Java by the symbol %. Modulo returns the remainder of the number in front of it divided by the number behind 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). 2. Now implement another method, multipleOfChecker, that takes two arguments, 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" You should test your methods in main using various combinations of inputs to rule out any logical bugs. Part 2 In this exercise you will write a method that takes a Scanner object from main and uses it to ask the user to input two doubles using the keyboard, surns 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. The method is named sqrtSunBucketer and it should work as follows: If user enters 23 and 16, then sartSumBucketer (input ); // Should print - Less than 10" If user enters 2 and 999, then sartSumBucketer (input); // Should print - Greater than 30." Part 3 Boolean Expressions Using pen and paper, figure out the truth-value of the following boolean expressions. Then put the following code in your Lab3's main and run it to check your answers. You will have to use print statements to check them. Please upload a picture of your handwritten work. boolean isFiveLess - 5 beatsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started