Write a method called isMultipleOfSeven which takes one integer parameter and returns a boolean indicating whether the value is divisible by 7 (return true if it's divisible by seven). At right you can see a single test case you can use to verify that your code compiles and to see what is the printed output of running your program, which you can use to ensure your method does the right thing. We recommend printing some cases in the run method to confirm what you have makes sense. We are auto-grading this problem with some hidden test cases which you cannot see. It is up to you to ensure your method does what is described above, otherwise you won't get points. HINT: We have discussed remainders. What is the remainder if int a is divisible by 7? isMultipleOfSeven(19); isMultipleOfSeven(49);
Please do the following picture way.
Write a method called isMultipleOfSeven which takes one integer parameter and returns a boolean indicating whether the value is divisible by 7 (return true if it's divisible by seven).
At right you can see a single test case you can use to verify that your code compiles and to see what is the printed output of running your program, which you can use to ensure your method does the right thing. We recommend printing some cases in the run method to confirm what you have makes sense.
We are auto-grading this problem with some hidden test cases which you cannot see. It is up to you to ensure your method does what is described above, otherwise you won't get points.
HINT: We have discussed remainders. What is the remainder if int a is divisible by 7?
isMultipleOfSeven(19);
isMultipleOfSeven(49);
Step by step
Solved in 3 steps with 1 images