Home /
Expert Answers /
Computer Science /
can-someone-fix-my-code-4-20-lab-count-multiples-write-a-program-that-takes-three-integers-as-inpu-pa546
(Solved): Can someone fix my code? 4.20 LAB: Count multiples Write a program that takes three integers as inpu ...
Can someone fix my code?
4.20 LAB: Count multiples Write a program that takes three integers as input: low, high, and x. The program then outputs the number of multiples of x between low and high inclusive. Ex: If the input is: 1102 the output is: 5 Hint: Use the % operator to determine if a number is a multiple of x. Use a for loop to test each number between low and high.
Load default template... 1nL iow, nigri, x; int numO+Multiples =?; // taking inputs 1ow = input. nextInt () ; high= input. nextInt(); x = input. nextInt(); // starting from Low count wultiples of x high using for loop for(int 1=low;1<=high;1+=x){ numofMultiples +=1; \} // print number of multiples System.out.println(numofMultiples); ? 3 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. Enter program input (optional) 1102 Input (from above) ? Output (shown below) Program errors displayed here LabProgram.java:11: error: cannot find symbol low = input. nextInt (); gymbol: variable input location: class LabProgram LabProgram.java:12: error: cannot find symbol high = input. nextInt (); LabProgram.java:11: error: cannot find symbol low = input. nextInt () ; symbol: variable input location: class LabProgram LabProgram.java:12: error: cannot find gymbol high = input nextInt ();