//COMPUTER SCIENCE 161.01 //MONDAY NOV 7th 2016 //SEQUENTIAL SEARCH (a.k.a. LINEAR SEARCH) //THE PROGRAM BELOW PERFORMS THE SEQUENTIAL SEARCH ALGORITHM //IT IS ALSO KNOWN AS THE 'LINEAR' SEARCH ALGORITHM //BECAUSE IT REQUIRES AT MOST N COMPARISONS WHERE N IS SIZE OF LIST //HERE, N is 15. lastNames = new Array("Collins", "Watson", "Sniffen", "Winkler", "Merritt", "Vick", "Lee", "Respeto", "Penn", "Malboeuf", "Johnson", "Cosby", "Aldridge", "Bryant", "Dyke" ); firstNames = new Array("Nick", "Dylan", "Dave", "Jay", "Hunter", "Clay", "Marquis", "Alexander", "Colin", "Bryan", "Chaise", "Jack", "Zachary", "Davis", "John" ); i=0; desiredName = prompt("Enter the last name of the person you wish to greet:"); found = false; //NOW, LET'S WRITE A LOOP TO GREET THIS PERSON USING HIS FIRST NAME while (found == false && i < lastNames.length) { if (lastNames[i] == desiredName) { alert("Happy Monday to " + firstNames[i]); found = true; } else i++; } if (found == false) alert("Could not find " + desiredName);