public class InOrder{
public static void main(String [] args){
String word1, word2, word3, word1Upper, word2Upper, word3Upper;
do{
word1=IO.getString("Enter first String");
word2=IO.getString("Enter second String");
word3=IO.getString("Enter the third word");
word1Upper=word1.toUpperCase();
word2Upper=word2.toUpperCase();
word3Upper=word3.toUpperCase();
if( word1Upper.compareTo(word2Upper) < 0){
if(word1Upper.compareTo(word3Upper) < 0){
System.out.println(word1Upper+", "+word2Upper+", "+word3Upper);
}else{
System.out.println(word1Upper+", "+word3Upper+", "+ word2Upper);
}
}else if(word2.compareTo(word1Upper) < 0){
if(word2.compareTo(word3Upper) < 0){
System.out.println(word2Upper+", "+word1Upper+", "+word3Upper);
}else{
System.out.println(word2Upper+", "+word3Upper+", "+word1Upper);
}
}else{
2007-12-20
03:17:17
·
3 answers
·
asked by
kjb281
1