subject

In this lab, you will write a C++ program for extracting the text from a webpage. You should implement 4 functions, described below. Your code should follow C++ conventions, and it should not use any libraries other than those we have discussed in class so far. You should submit your code as a single. cpp source file, and your code should be able to be compiled with g++. • string readFile(string filename) • This function opens the file with the given name, reads in the entirety of the file, and returns a string containing the file contents. It should return the empty string if the file doesn't exist string extractParagraphs(string content) This function should return all of the paragraph contents in the given HTML content, and each paragraph should be followed by two new lines (\n\n). Paragraphs in HTML start with a paragraph start tag () and end with a paragraph end tag ( ), and the contents are between these two tags. The output should not include any of the start or end tags. string remove Tags(string content) This function should search the given HTML content and remove all of the HTML tags. All HTML tags start with a less than sign (<) and end with a greater than sign (>), and anything that begins with a less than sign and ends with a greater than sign is an HTML tag. • int main() o main() should use the other 3 functions to read in the contents of input. html, extract all of the paragraphs in this file, remove the tags from the paragraphs, and print the result to cout. Recommendations First, start with a main function that calls all 3 of the other functions and just "stub out" the other 3 function. "Stubbing out" a function (or "writing a function stub") involves writing the function prototype with an empty or 1-line body that mostly exists so that the source code can compile (empty body for void functions, and a 1-line return statement for other functions). In this case, all 3 functions should just return their argument. Then, implement each function one at a time (readFile, then extractParagraphs, then remove Tags), and test the output of each function before starting on the next one. I've provided you three sample input files, as well as the correct output after extracting the paragraphs and removing the HTML tags. Samolennu fler

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 15:30
The song about casey jones a railroad engineer who gives his life on the job would most likely gall under the folk song category of? a-work song b-nonsense song c-religious song d-ballad
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
Which of the following is not an enhancement to the standard wiki to make it more attractive for corporations? encryptionwork spacespermission toolspredictive text
Answers: 2
question
Computers and Technology, 24.06.2019 03:00
Click the "draw structure" button to activate the drawing utility. draw two diastereomers of (1z,4r)−1,4−dimethylcyclodecene and name them, including (e)/(z) and (r)/(s) notation. part 1 out of 4 draw the diastereomer containing a chiral center with s configuration here. window open
Answers: 1
question
Computers and Technology, 24.06.2019 15:30
The idea that, for each pair of devices v and w, there’s a strict dichotomy between being “in range” or “out of range” is a simplified abstraction. more accurately, there’s a power decay function f (·) that specifies, for a pair of devices at distance δ, the signal strength f(δ) that they’ll be able to achieve on their wireless connection. (we’ll assume that f (δ) decreases with increasing δ.) we might want to build this into our notion of back-up sets as follows: among the k devices in the back-up set of v, there should be at least one that can be reached with very high signal strength, at least one other that can be reached with moderately high signal strength, and so forth. more concretely, we have values p1 ≥ p2 ≥ . . ≥ pk, so that if the back-up set for v consists of devices at distances d1≤d2≤≤dk,thenweshouldhavef(dj)≥pj foreachj. give an algorithm that determines whether it is possible to choose a back-up set for each device subject to this more detailed condition, still requiring that no device should appear in the back-up set of more than b other devices. again, the algorithm should output the back-up sets themselves, provided they can be found.\
Answers: 2
You know the right answer?
In this lab, you will write a C++ program for extracting the text from a webpage. You should impleme...
Questions
question
Mathematics, 22.01.2020 07:31
question
Mathematics, 22.01.2020 07:31
question
Mathematics, 22.01.2020 07:31
question
Mathematics, 22.01.2020 07:31