|
int day = (int)(Math.random() * 7) + 1; //random# from 1 to 7
//go backwards
for (int i=day; i>=1; i--){
System.out.println(fullNameofDay(i));
}
for (int i=7; i>=day+1; i--){
System.out.println(fullNameofDay(i));
}
//go forwards
for (int i=day; i<=7; i++){
System.out.println(abbrDay(i));
}
for (int i=1; i<day; i++){
System.out.println(abbrDay(i));
}
Hopefully that should point you in the right direction
|