Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Programming Q1: Write a program that will - Read in the contents of a text file up to a maximum of 1024 words-you create

image text in transcribed

C++ Programming Q1: Write a program that will - 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 charactersetc. Sortthe words read in ascending order in an array (you are notallowed to use Vectors) using the Selection Sortalgorithm implemented in its own function Search any item input by user in your sorted list using the Binary Search algorithm implemented in its own function. Use string comparisons as taught in CIS 22A for comparing/ordering words, i.e.words starting with numbers sortlower than words starting with uppercase letters which are lowerthan words starting with lowercase letters. So a word appearing once with one set of case is differentthan its second appearance with a differentset of case,e.g. 'Do'and 'do are notthe same If a word appearstwice 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. Your program will name from where to read the file and location+name where to save the first ask the user for a location outputfile read the contents into an array, ignoring single character words, sortthe contents of the array in alphabetically ascending order and then start a loop to allow the user to search for one or more words in the array-your loop should have an appropriate exitcondition. If the word is found, the program should outputwhich array location the word was found in, if notfound then it should output an appropriate message Provide clear prompts as necessaryfor good user interactivity Your output should be sentto both screen and an outputfile concurrently.Screen output should contain the entire user interaction. The file outputshould contain all the user interaction thatwentto the screen as well as the listing of the sorted array User interactivity should be limited to your main, input and/or outputfunctions only - what that means is your cin/cout should only be in those 3 functions. Your output will consist of at least 4 files-your CPP file, your text input, the screen outputand file outputs. Compress all of these into a single ZIP file formatto upload. I will test your program with my own input file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions