Question: The files provided in the code editor to the right contain syntax and / or logic errors. In each case, determine and fix the problem,
The files provided in the code editor to the right contain syntax andor 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.
An example of the program is shown below:
Enter a number between and
Blastoff!
Depending on the value assigned to the TIMEWASTER constant, the time delay between output may be several seconds.
The program given in java:
Prompt user for value to start
Value must be between and inclusive
At command line, count down to blastoff
With a brief pause between each displayed value
import java.util.Scanner;
public class DebugSix
public static void mainString args
Scanner keyboard new ScannerSystemin;
int userNum, val;
final int MIN ;
final int MAX ;
final int TIMEWASTER ;
System.out.printEnter a number between MIN
and MAX ;
userNum keyboard.nextInt;
whileuserNum MIN && userNum MAX
System.out.printlnNumber out of range";
System.out.printEnter a number between MIN and
MAX inclusive ;
userNum keyboard.nextInt;
forval userNum; val ; val
System.out.printval ;
forint x ; x TIMEWASTER; x
forint y ; y TIMEWASTER; y
forint z ; z TIMEWASTER;;
Adjust these numbers for faster or slower performance
System.out.printlnBlastoff;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
