JAVA HELP (NEEDS TO BE ABLE TO RUN IN ECLIPSE)?
JAVA HELP (NEEDS TO BE ABLE TO RUN IN ECLIPSE)?
I need some help with my java program.
if you can fix this to be what the teacher wants
cs.ecu.edu/rhoggard/2310/assignments/assg10.htm
import java.util.*;
public class LargeNums {
public static Scanner keyboard;
static final int MAXSIZE=20;
public static void main(String[] args) {
Scanner keyboard=new Scanner(System.in);
String input, userInput;
int [] num1, userEntry, userResult, num;
num1=new int [MAXSIZE];
userEntry=new int [MAXSIZE];
userResult=new int [MAXSIZE];
System.out.println(“Please enter a number up to ” + MAXSIZE + ” digits long to be added to another digit: “);
userInput=keyboard.next();
for ( int x = userInput.length() – 1, pos = MAXSIZE – 1, errorCount = 0; x >= 0; x–){
if(Character.isDigit(userInput.charAt(x))){
errorCount++;
if (errorCount > MAXSIZE){
System.out.println(“Error! You have entered more than ” + MAXSIZE + ” digits…”);
System.exit(0);
}
num [x] = userInput.charAt(x) – ’0′;
userInput[pos] = num;
pos–;
}
}
System.out.println(“Please enter another digit up to ” +MAXSIZE+ ” digits long to be added to the first digit:”);
input=keyboard.next();
}
}
Best answer:
Without knowing what the problem is, it is very difficult to help.
Tags: ABLE, ECLIPSE, HELP, java, needs
Under Forum

Leave a Comment for JAVA HELP (NEEDS TO BE ABLE TO RUN IN ECLIPSE)?
Trackback this post | Subscribe to the comments via RSS Feed