subject

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");
}
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
Requirement types discussed during software development include functional and color scheme nonfunctional and code style constraint and nonfunctional fashionable and functional.
Answers: 2
question
Computers and Technology, 22.06.2019 19:20
Consider the following code snippet: #ifndef cashregister_h#define cashregister_hconst double max_balance = 6000000.0; class cashregister{public: cashregister(); cashregister(double new_balance); void set_balance(double new_balance); double get_balance() const; private: double balance[12]; }; double get_monthly_balance(cashregister bk, int month); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_balance should be removed since header files should not contain constants.c)the definition of cashregister should be removed since header files should not contain class definitions.d)the body of the get_monthly_balance function should be added to the header file.
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Other - a written response, no less than arial 12-point font, to the following: of the following, which would you consider is most important to customer service goals? choose one and explain why. (1) accuracy (2) punctuality and attendance (3) courtesy (4) productivity (5) organization
Answers: 1
question
Computers and Technology, 24.06.2019 19:50
Which is a characteristic of free and open-source software licenses? a. the source code is unavailable to everyone b. the source code is available only to the government c. the source code is available to all users d. the source code is constantly modified
Answers: 1
You know the right answer?
The files provided in the code editor to the right contain syntax and/or logic errors. In each case,...
Questions
question
Mathematics, 29.05.2021 03:40
question
Mathematics, 29.05.2021 03:40
Questions on the website: 13722362