The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. This is the code. I have fixed some of it but it still won't accept it -    // Displays five random numbers between  // (and including) user-specified values import java.util.Scanner; public class DebugSix4 {    public static void main(String[] args)    {       int high, low, count = 0;       final int NUM = 5;       Scanner input = new Scanner(System.in);       System.out.print("This application displays " + NUM +          " random numbers" +          "\nbetween the low and high values you enter" +          "\nEnter low value now... ");       low = input.nextInt();       System.out.print("Enter high value... ");       high = input.nextInt();       while(low < high)       {          System.out.println("The number you entered for a high number, " +             high + ", is not more than " + low);          System.out.print("Enter a number higher than " + low + "... ");          high = input.nextInt();              while(count < NUM)       {          double result = Math.random();          int answer = (int) (result * 10 + low);          if(answer <= high)          {             System.out.print(answer + "  ");             ++count;          }       }       System.out.println("End of Application");    } } }

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 1DE
icon
Related questions
Question
100%

This is a debugging problem -

The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.

This is the code. I have fixed some of it but it still won't accept it - 
 
// Displays five random numbers between 
// (and including) user-specified values
import java.util.Scanner;
public class DebugSix4
{
   public static void main(String[] args)
   {
      int high, low, count = 0;
      final int NUM = 5;
      Scanner input = new Scanner(System.in);
      System.out.print("This application displays " + NUM +
         " random numbers" +
         "\nbetween the low and high values you enter" +
         "\nEnter low value now... ");
      low = input.nextInt();
      System.out.print("Enter high value... ");
      high = input.nextInt();
      while(low < high)
      {
         System.out.println("The number you entered for a high number, " +
            high + ", is not more than " + low);
         System.out.print("Enter a number higher than " + low + "... ");
         high = input.nextInt();
      

      while(count < NUM)
      {
         double result = Math.random();
         int answer = (int) (result * 10 + low);
         if(answer <= high)
         {
            System.out.print(answer + "  ");
            ++count;
         }
      }
      System.out.println("End of Application");
   }
}
}
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT