Linear-Search

Populate a 10-element char array with random chars from a-z lowercase.

  1. Build a function that takes in this array and searches for the first instance of the char 'a' that it finds. This function should return the index where it found the 'a' or -1 if it did not find an 'a'.

    For testing purposes... in the main print the array and the result of the search.

  2. Extend the function to search for any letter, not just 'a'.

  3. For the User Interface:

    A. Print the random array of chars to the screen for the user to see.

    B. Ask the user what char to linear search for.

    C. Find the char and print the index to the screen for the user to see.

    D. Ask the users if they would like to search for another char in the same array.