Question: The guidelines for the code along with their outputs are below. Along is a code however it is not outputting the correct one. I need
The guidelines for the code along with their outputs are below. Along is a code however it is not outputting the correct one. I need help solving that mistake so that the code outputs the multiples of the divisor
Guidelines + Outputs


Code and outputs:



This program asks for two inputs from the user: Max number, maxnum Divisor, divisor Then it displays all numbers that are multiples of divisor starting at 1 up to maxnum (inclusive) as shown in the sample runs below. You must use the remainder (%) operation for this task. Sample Runs (user input shown in green, with each run separated by a dashed line): Please enter the max number: 10 Please enter the divisor: 2 Multiples of 2 between 1 and 19 (inclusive) are: 10 Please enter the max number: -2 Invalid input. Please enter a valid max number (> Invalid input. Please enter a valid max number (> Please enter the divisor: 3 Multiples of 3 between 1 and 10 (inclusive) are: 0): 0): -8 10 Please enter the max number: 8 Please enter the divisor: -2 Invalid input. Please enter a valid divisor (> 0): Invalid input. Please enter a valid divisor (> 0): -5 Invalid input. Please enter a valid divisor (> 0): 10 Multiples of 10 between 1 and 8 (inclusive) are: No number were found. Please enter the max number: 9 Invalid input. Please enter a valid max number (> Invalid input. Please enter a valid max number (> Please enter the divisor: 0 ): 10 0): 25 Invalid input. Please enter a valid divisor (>0): Invalid input. Please enter a valid divisor (>0): -8 Invalid input. Please enter a valid divisor (>0): 4 Multiples of 4 between 1 and 25 (inclusive) are: 6- Quick Access 64 H@ @ 21 #9999 Find Duplicate Count.java D *Remainder Funcsample.java X 1 import java.util.Scanner; 2 public class Remainder Funcsample { public static void main(String[] args) { // TODO Auto-generated method stub Scanner kbd = new Scanner(System.in); int count = 0; int rem = 0; int maxnum, divisor; System.out.print("Please enter the max number: "); maxnum = kbd.nextIntO; while (maxnum = 0): "); maxnum = kbd.nextInt(); System.out.print("Please enter the divisor: "); divisor - kbd.nextInt(); while (divisor 0): "); divisor - kbd.nextInt(); System.out.println("Multiples of " + divisor + " between 1 and " + maxnum + " (inclusive) are: "); for (int i = 1; i = maxnum; i++) { rem = (i % divisor); if (rem == 0); { System.out.print(i); count ++; if (count == 0) System.out.print("No number was found"); kbd.close(); 413 Console X RemainderFuncsample [Java Application) /Library/Java/JavaVirtual Machines/jdk1.8.0_221.jdk/Contents/Home/bin/java (Jan 30, 2020, 12:51:32 PM) Please enter the max number: 10 Please enter the divisor: 2 Multiples of 2 between 1 and 10 (inclusive) are: 12345678910 Writable Smart Insert 34:5 @ OP EET #99996- Quick Access : Find Duplicate Count.java RemainderFuncsample.java X 1 import java.util.Scanner; 2 public class Remainder Funcsample { + in public static void main(String[] args) { // TODO Auto-generated method stub Scanner kbd = new Scanner(System.in); int count = 0; int rem = 0; int maxnum, divisor; 9 System.out.print("Please enter the max number: "); maxnum = kbd.nextIntO; while (maxnum = 0): "); maxnum = kbd.nextInt(); System.out.print("Please enter the divisor: "); divisor - kbd.nextInt(); while (divisor 0): "); divisor - kbd.nextInt(); 99 SNNNNNNNNMMMmmmm System.out.println("Multiples of " + divisor + " between 1 and " + maxnum + " (inclusive) are: "); for (int i = 1; i = maxnum; i++) { rem = (i % divisor); if (rem == 0); { System.out.print(i); count ++; if (count == 0) System.out.print("No number was found"); kbd.close(); 413 Ex : b = 8: E , , B @ Console X RemainderFuncsample [Java Application) /Library/Java/JavaVirtual Machines/jdk1.8.0_221.jdk/Contents/Home/bin/java (Jan 30, 2020, 12:52:21 PM) Please enter the max number: -2 Invalid input. Please enter a valid max number (>= 0): -8 Invalid input. Please enter a valid max number (>= 0): 10 Please enter the divisor: 3 Multiples of 3 between 1 and 10 (inclusive) are: 12345678910 @ OP EET #99996- Quick Access : Find Duplicate Count.java RemainderFuncsample.java X 1 import java.util.Scanner; 2 public class Remainder Funcsample { + in public static void main(String[] args) { // TODO Auto-generated method stub Scanner kbd = new Scanner(System.in); int count = 0; int rem = 0; int maxnum, divisor; 9 System.out.print("Please enter the max number: "); maxnum = kbd.nextIntO; while (maxnum = 0): "); maxnum = kbd.nextInt(); System.out.print("Please enter the divisor: "); divisor - kbd.nextInt(); while (divisor 0): "); divisor - kbd.nextInt(); 99 SNNNNNNNNMMMmmmm System.out.println("Multiples of " + divisor + " between 1 and " + maxnum + " (inclusive) are: "); for (int i = 1; i = maxnum; i++) { rem = (i % divisor); if (rem == 0); { System.out.print(i); count ++; if (count == 0) System.out.print("No number was found"); kbd.close(); 413 Ex : b = 8: E , , B @ Console X RemainderFuncsample [Java Application] /Library/Java/JavaVirtual Machines/jdk1.8.0_221.jdk/Contents/Home/bin/java (Jan 30, 2020, 12:52:59 PM) Please enter the max number: -9 Invalid input. Please enter a valid max number (>= 0): -10 Invalid input. Please enter a valid max number (>= 0): 25 Please enter the divisor: 0 Invalid input. Please enter a valid divisor (>0): 0 Invalid input. Please enter a valid divisor (>0): -8 Invalid input. Please enter a valid divisor (> 6): 4 Multiples of 4 between 1 and 25 (inclusive) are: 12345678910111213141516171819202122232425