Computers and Technology

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 !

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 10:50, whyidkmyself
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
image
Computers and Technology, 23.06.2019 17:00, taytay1828
What are the 12 colors of the spectrum called?
Answers: 1
image
Computers and Technology, 24.06.2019 00:50, anthonycraig0205
3. what is the output of the following statements? temporary object1; temporary object2("rectangle", 8.5, 5); temporary object3("circle", 6, 0); temporary object4("cylinder", 6, 3.5); cout < < fixed < < showpoint < < setprecision(2); object1.print(); object2.print(); object3.print(); object4.print(); object1.set("sphere", 4.5, 0); object1.print();
Answers: 1
image
Computers and Technology, 24.06.2019 03:30, ava1018
The footer area of a web page generally houses which website feature? terms of use web page content business name or title menu headings
Answers: 1
Do you know the correct answer?
This what my teacher says about my lab q1: write a program that will – read in the contents of a te...

Questions in other subjects:

Konu
Biology, 20.05.2020 18:57
Konu
Mathematics, 20.05.2020 18:57
Konu
Biology, 20.05.2020 18:57