list = new Array("Nick Collins", "Dylan Watson", "David Sniffen", "Jacob Mann", "Hunter Merritt", "Clay Vick", "Marquis Lee", "Alexander Respeto"); // 1) Write a loop to say good morning to everyone i = 0; //start at left end of array N = list.length; //in order to visit everyone while (i < N) { alert("Good morning " + list[i]); //good morning to current person i++; //move to next person } // 2) Write a loop to do the same, but address everybody by first name i = 0; //start at left end of array N = list.length; //in order to visit everyone while (i < N) { firstName = list[i].substring(0, list[i].charAt(" ")); //peel off up to space alert("Good morning " + firstName); //good morning to current person i++; //move to next person } // 3) Write a loop to do the same, but address everybody by last name i = 0; //start at left end of array N = list.length; //in order to visit everyone while (i < N) { lastName = list[i].substring(list[i].charAt(" ") + 1, list[i].length); //peel off everything after the space alert("Good morning Mr. " + lastName); //good morning to current person i++; //move to next person } // 4) Write a loop to do the same but address everybody using their last initial i = 0; //start at left end of array N = list.length; //in order to visit everyone while (i < N) { lastName = list[i].substring(list[i].charAt(" ") + 1, list[i].length); //peel off everything after the space alert("Good morning Mr." + lastName.charAt(0)); //good morning to Mr.C, etc.. i++; //move to next person } // 5) Write a loop that alerts us with the following Nick Collins likes Dylan Watson Dylan Watson likes David Sniffen ... etc ... Marquis Lee likes Alexander Respeto ... and finally ... Alexander Respeto likes Nick Collins i = 0; //start at left end of array N = list.length; //in order to visit everyone while (i < N-1) { //N-1 guys have neighbors on their right alert(liat[i] + " likes " + lisi[i+1]); //begins with Nick Collins likes Dylan Watson i++; //move to next person } alert(list[N-1] + " likes " + list[0]); //in order to say Alexander Respeto likes Nick Collins