Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

finding the problem on code

  Asked By: BERTO    Date: Nov 13    Category: Java    Views: 671
  

Hi everyone,

I've been having problem with this code, I was doing a homework and I was trying to fix this code and I do all I know, however the program isn't still working and sometimes desn't compiled, If enyone can help me, I'll appreciate, thank you.

import javax.swing.*;
public class FixDebugSix3
{
public static void main(String[] args)
{
String userNumString;
int userNum, val;
final int MIN = 1;
final int MAX = 20;
userNumString = JOptionPane.showInputDialog(null,
"Enter a number between " + MIN + " and " + MAX + " inclusive");
userNum = Integer.parseInt(userNumString);
while((userNum < MIN) && (userNum > MAX))
{
userNumString = JOptionPane.showInputDialog(null,
"Number out of range" +
"\nEnter a number between " + MIN + " and " + MAX + " inclusive");
userNum = Integer.parseInt(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!");
}
}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on finding the problem on code Or get search suggestion and latest updates.




Tagged: