Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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.

// Prompt user for value to start // Value must be between 1 and 20 inclusive // At command line, count down to blastoff // With a brief pause between each displayed value import java.util.*; public class DebugSix3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); String userNumString; int userNum, val; final int MIN = 1; final int MAX = 20; System.out.println("Enter a number between " + MIN + " and " + MAX + " inclusive"); userNumString = input.next(); userNum = Interger.parseInt(userNumString); while(userNum < MIN || userNum = MAX) { System.out.println("Number out of range" + " Enter a number between " + MIN + " and " + MAX + " inclusive"); userNumString = input.next(); userNum = Integer.parse(userNumString); } for(val = userNum; val < 0; --val) { System.out.print(val + " "); for(int x = 0; x < 100000; ++x) for(int y = 0; y < 10000; ++y); // Adjust these numbers for faster or slower performance } System.out.println("Blastoff!"); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

Create a Fishbone diagram with the problem being coal "mine safety

Answered: 1 week ago