//COMPUTER SCIENCE 161.01 //MONDAY NOV 6th 2017 //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("Donelson", "Cronk", "Reilly", "King", "Smith", "Weinberg", "Shaw", "Lowman", "Quinn", "Lemon", "OBrien", "Tribble", "Haynes", "St.Clair", "Carrigan" ); firstNames = new Array("Andrew", "Kyle", "Andrew", "David", "Brandon", "Brendan", "Connor", "Miles", "Donovan", "Charlie", "Jake", "Preston", "Seth", "Bryce", "Riley" ); 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);