how to do repeated sequance check : the question is this:

Question 3: Repeated Sequence Check
The program should enter a string (possibly containing blanks), and determine whether the characters are in
lexicographic order.
For example”
• “12AABab” is in order since each character is less than or equal to the one following it (‘1’ < ‘2’, ‘2’ <
‘A’, ‘B’ < ‘a’, etc.) according to the Unicode character sequence.
• “abCDef” is out of order, because ‘b’ > ‘C’ (lower-case letters come after upper-case letters in the
Unicode sequence).
If the string is in order, the program should display “The input is in order”; otherwise, it should display
“The input is out of order”
The program should repeat this process until the user enters the string “quit”, regardless of case. It should
not check the sequence of “quit”.
Finally, the program should display “Goodbye”.

Notes:
• This program will require nested loops. The inner loop will check the sequence of the input, while
the outer loop will repeat the input and check process.
• Be sure to reinitialize all variables at the start of the outer loop.
• A string of length 0 or 1 is considered to be in order by definition.


what i could do best is:(i tried with 2 other different methods i could send it too if you like) 


package homelab03;

import java.util.Scanner;

public class Quest3deneme3 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		String whole,remain,d,e;
		char h1,h2;
		int lenght,b,c,sayac;
		//int[] a;
		String[] a;
		
		Scanner keyboard = new Scanner(System.in);
		System.out.println("Enter an input string:");
		whole = keyboard.nextLine();
		whole=whole.replaceAll("\\s+","");
		lenght=(int)whole.length();
		//System.out.println(+lenght);
		remain=whole;
		sayac=0;
		c=0;
		b=0;
		a= new String[lenght];
		
		//boolean cem = d.compareTo(e);
		while(b<lenght)
		{
			
			a[b]=remain.substring(b,b+1);
			remain=remain.substring(b+1);
			System.out.println(a[b]);
			d=a[b];
			e=a[c];
			while(a[b]<a[c] )
			{
			sayac=sayac+1;
			h1=h2;
		}
		}	
			if(sayac==lenght)
			{
				System.out.println("oley");
			}
			else
			{
				System.out.println("nooo");
			}
		
		
	}
	//a[b]=remain.substring(b,b+1);
	//remain=whole.substring(b+1);
	//System.out.println(a[b]);

}

note we havent learned a[b] <= this thing yet but i find it online if the solution wont require that that would be better.
note 2: we havent learned regex either i  think that might be dissalowed(i found some answers with that online but i think i wont get credit for that)

thank you guys in advance

