Question: Finding multiples We ve learned that in programming, there is a special operator for getting the whole number remainder of division: The Modulo Operator! So

Finding multiples Weve learned that in programming, there is a special operator for getting the
whole number remainder of division: The Modulo Operator! So,12%9 will give us a value of
3, since 9 goes evenly into 12 once with a remainder of 3.
There are many uses for this operator which we will learn throughout the semester. In this
assignment, were going to use it to find the nearest multiple of a number based on user input.
For example, if were looking for multiples of 6, then the nearest multiple from 13 is 12, and
the nearest multiple from 22 is 18(rounded down).
Your task is to:
a) Ask the user to enter a whole number they want to find a multiple of
b) Read that value in
c) Ask the user to enter a second number
d) Read that value in
e) Use the Modulo Operator to find the nearest multiple of the first number from the
second number
f) Display the result to the user
in java

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!