The exact problem I am having is that I can't find out if there is a way to ask the user to enter a set of integers of the form 0...some integer say 10 in the form 0...10 and have java take it to mean all the integers from 0 to 10. as in 0 1 2 3 4 5 6 7 8 9 10 . this is common notation in the math world.
the closest approximation i can think of in code
System.out.print( "please enter the first and last integers of the set in the form a...b: ");
something in here that actually takes the set and passes it to an array without needing several hundred or thousand variables declared.
and then have java put those values into an array. rather than have a set with 1000 integers in it and having something like
System.out.print(" please first integer: ");
int a = input.nextInt();
System.out.print("please enter second integer: ");
int b = input.nextInt();
.
.
.
.
.
1000 times
What i came up with is entering the first value and then the last value and trying to put it into a for loop with an array.
public double setAlength( double al )
{
al = last - first;
}
public double setGroupArray( double garray[])
{
groupArray = garray;
for( double counter = 0; counter < alength; counter++)
{
garray[counter] = first + counter;
}
this seems clumsy though and i don't really think i have it set up right yet, a big problem with this is that some algebraic groups do not start at 0 or a positive number which would cause issues when you get into the negative numbers. However i'm not asking you to tell me how to write the code, i'm asking if anyone knows if there is something in java to accept entering mathematical sets in this nature..and if there is then where i might find out about it. Any critiques and suggestions of the code will be accepted in a gracious manner if you feel like offering them..but I don't ask people to do my work for me. i will succeed or fail on my own. The string tokenizer will work the data after it's been input into the program, but i'm trying to change the way the data is input into the program...if i'm understanding what i read about it correctly, if i'm not feel free to say so. If i was just going to confine it to easily entered sets for groups it wouldn't be an issue, but easily entered sets for groups are easily validated or invalidated by hand. i don't know about anyone else but a program that is supposed to make life easier that makes you input several thousand numbers doesn't really seem to be worth it.