//COMPUTER SCIENCE 161.01 //MONDAY NOV 12th 2018 //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("Haiss", "Branch", "McVey", "Gilliam", "Clagett", "Valente", "Atkinson", "Molali", "Hiter", "Davis", "Wilkins", "Morgan", "Burleson", "Arrington", "Sydney"); firstNames = new Array("David", "Zach", "Robert", "Hunter", "Bobby", "Tom", "Wes", "Will", "Ben", "Michael", "Austin", "Chris", "Alex", "Ben", "Algernon"); 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);