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, 22.06.2019 13:00
Write a program which asks you to enter a name in the form of first middle initial last. so you might enter for example samuel p. clemens. use getline to read in the string because it contains spaces. also, apparently the shift key on your keyboard doesn’t work, because you enter it all lower case. pass the string to a function which uses .find to locate the letters which need to be upper case and use toupper to convert those characters to uppercase. the revised string should then be returned to main in the form last, first mi where it will be displayed.
Answers: 1
question
Computers and Technology, 22.06.2019 23:50
You need to design a circuit that implements the functions in the following table: s0 s1 function0 0 a + 10 1 a – b1 0 a + b1 1 a – 1s0 and s1 are 1-bit control inputs to select the function of the circuit. inputs a and b are 4-bitnumbers in 2s complement form. the output is also a 4-bit number in 2s complement form.you are allowed to use only one ttl 7483 4-bit adder to implement all the functions. but anynumber of other components (except the adder) can be used.hint: design a combinational logic circuit to modify the input b and the β€œcarry input” of theadder depending on the control inputs s0 and s1.important: lab grade will depend on the working of the circuit & will be checked of by your labinstructor.1. is the output valid for the following input combinations: a. s0 = 0, s1 = 0, a = 7, b = 3? b. s0 = 0, s1 = 1, a = 7, b = 3? c. s0 = 1, s1 = 0, a = -4, b = -5? d. s0 = 1, s1 = 1, a = -8, b = 6? 2. what is the range of inputs (for both a and b) that will produce the valid output for all the functions?
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
Answers: 2
question
Computers and Technology, 24.06.2019 03:30
Auniform resource locator (url) is a formatted string of text that web browsers, email applications, and other software programs use to identify a particular resource on the internet. true false
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, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Social Studies, 17.09.2020 22:01
question
Physics, 17.09.2020 22:01
question
English, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
World Languages, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
English, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
question
Mathematics, 17.09.2020 22:01
Questions on the website: 13722367