Modify the attached project to exactly work the same as shown sample results below: Sample result 1: This program finds
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Modify the attached project to exactly work the same as shown sample results below: Sample result 1: This program finds
Modify the attached project to exactly work the same as shown sample results below: Sample result 1: This program finds all divisible by N numbers between 0 and M. Please enter M (M should be an integer number): 100 Please enter N (N should be an integer number): 7 There are 14 divisible by N number between 0 and 100. The divisible by 7 number (s) between 0 and 100: 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, 98 Process finished with exit code 0 Sample result 2: This program finds all divisible by N numbers between 0 and M. Please enter M (M should be an integer number): 10 Please enter N (N should be an integer number): 8 There is one divisible by 8 number between 8 and 10. The divisible by 8 number (s) between 0 and 10: 8 Process finished with exit code 6 Sample result 3: This program finds all divisible by N numbers between 0 and M. Please enter M (M should be an integer number): 7 Please enter N (N should be an integer number): 100 There is no divisible by 100 number between 0 and 7. Process finished with exit code 0
1 2 3 4 67 88032 9 import java.util.Scanner; public class divisibleByN { B public static void main(String[] args) { /* Note: 1- you do not need (and should not) to import any additional package/class. 2- We have not covered the concept of arrays yet, and we do not need an array to handle this program. So you should not use any array. Hint: See if java.lang. Integer.toString() is helpful. Note that the java.lang package is always imported by default for Java. 10 11 8 } 12 }