Computers and Technology

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.

// 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 = inputnextInt();
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 <= higher)
{
System. out. print(answer + " ");
++count;
}
}
System. out. println("End of Application");
}
}

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 01:10, kristofwr3444
Are special combinations of keys that tell a computer to perform a command. keypads multi-keys combinations shortcuts
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, jayjay5246
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
image
Computers and Technology, 24.06.2019 23:00, Jennifer312332
Hypertension occurs when blood pressure is too high.
Answers: 1
image
Computers and Technology, 25.06.2019 01:00, 59279
Why is outfitting a workplace with video games in a technology development company consiered a strategic use of money
Answers: 1
Do you know the correct answer?
The files provided in the code editor to the right contain syntax and/or logic errors. In each case,...

Questions in other subjects:

Konu
Chemistry, 09.06.2020 23:57
Konu
Mathematics, 09.06.2020 23:57
Konu
Mathematics, 09.06.2020 23:57