subject

This what my teacher says about my lab 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 characters etc. sort the words read in ascending order in an array (you are not allowed to use vectors) using the selection sort algorithm 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 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. 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. 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 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 exit condition. if the word is found, the program should output which array location the word was found in, if not found then it should output an appropriate message. provide clear prompts as necessary for good user interactivity. 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. 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. make sure your text input, the screen output and file outputs are all inside of your msvc project folder. compress all of these into a single zip file format to upload. if you have a hidden folder inside your project folder called '.vs', remove it before compressing, otherwise your zip file will be too large to upload. i will test your program with my own input file. this is my code #include "stdafx. h" #include #include #define size 1024 using namespace std; char* readfile(string filename) { ifstream infile; infile. open(filename); char carray[size]; char letter; int index = 0; while (infile. get(letter)) { if (index > = = size) { break; } carray[index] = letter; index++; } infile. close(); return carray; } i'm not sure that i'm doing write someone explain to me step by step. its !

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 08:30
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
For which utilities, if any, does the landlord pay?
Answers: 2
question
Computers and Technology, 24.06.2019 09:50
Suppose you are an ad-serving company and you maintain a log of cookie data for ads you serve to the web pages for a particular vendor (say amazon). a. how can you use this data to determine which are the best ads? b. how can you use this data to determine which are the best ad formats? c. how could you records of past ads and ad clicks to determine which ads to send to a given ip address? d. how could you use this data to determine how well the technique you used in your answer to part c was working? e. how could you use this data to determine that a given ip address is used by more than one person? f. how does having this data give you a competitive advantage vis-à-vis other ad-serving companies?
Answers: 2
question
Computers and Technology, 24.06.2019 10:30
Which of the following types of software is most applicable to the promotion of new products through advertising? a.databases b. spreadsheets c. web design programs d. word processing tools
Answers: 2
You know the right answer?
This what my teacher says about my lab q1: write a program that will – read in the contents of a te...
Questions
question
Mathematics, 16.04.2021 21:50
question
Mathematics, 16.04.2021 21:50
question
Mathematics, 16.04.2021 21:50
question
Mathematics, 16.04.2021 21:50
Questions on the website: 13722360