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, 22.06.2019 17:00
The two main ways in which marketers address the competition with their strategies are by satisfying a need better than a competition and by
Answers: 2
question
Computers and Technology, 24.06.2019 02:30
Write the pseudo code for this problem based on what you learned from the video. the purpose is to design a modular program that asks the user to enter a distance in kilometers, and then converts that distance to miles. the conversion formula is as follows: miles = kilometers x 0.6214
Answers: 3
question
Computers and Technology, 24.06.2019 03:30
It is not necessary to develop strategies to separate good information and bad information on the internet. true or false
Answers: 1
question
Computers and Technology, 24.06.2019 19:00
Luis is cloud-based( microsoft bot framework). true false
Answers: 1
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, 03.02.2020 05:51