Write a program that will

1.Read in the contents of a text file up to a maximum of 1024 words you create your own input. When reading the file contents, you can discard words that are single characters to avoid symbols, special characters etc.

2.Sort the words read in ascending order in an array using the Selection Sort algorithm implemented in its own function.

3.Search any item input by user in your sorted list using the Binary Search algorithm implemented in its own function.

4.Use string comparisons as taught in CIS 22A for comparing/ ordering words, i.e. words starting with numbers sort lower than words starting with uppercase letters which are lower than words starting with lowercase letters. So a word appearing once with one set of case is different than its second appearance with a different set of case, e.g. 'Do' and 'do' are not the same.

5.If a word appears twice using exactly the same case, it can be stored twice side-by-side in the array and either index can be returned in the search.

6.Your program will:

  • first ask the user for a location+name from where to read the file and location+name where to save the output file,
  • read the contents into an array, ignoring single character words,
  • sort the contents of the array and
  • then ask the user for words to search - this should happen in a loop with an appropriate exit condition.
  • Provide clear prompts as necessary for good user interactivity.

7.Your output should be sent to both screen and an output file concurrently. Screen output should contain the entire user interaction. The file output should contain all the user interaction that went to the screen as well as the listing of the sorted array.

8.User interactivity should be limited to your main, input and/or output functions only - what that means is your cin/cout should only be in those 3 functions.

9.Your output will consist of 4 files your code files, your text input, the screen output and file outputs. Compress all of these into a single ZIP file format to upload.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.