Help with this c++ question!!!

Me and my friends are currently in a computer science class and can't figure out this programming question at all! any help would be greatly appreciated!!!

1. Write a program to generate a link farm of 10 web
pages. A link farm is a group of junk web pages that link
to one another in order to boost the ranking of these
pages in the indexes of search engines. Each of these 10
pages is an html file, named “page1.html”, “page2.html”,
“page3.html”, ... “page10.html”, is built using the html
elements listed below. A page contains anywhere from 5
to 10 randomly selected content items from “junk.txt”,
along with links to 3 other randomly selected pages in the
link farm. Your submission should include a screenshot of
the program using the following script. An example of a page is shown in Fig. 1.
• <html>...</html> page begin and end tags.
• <head>...</head> header begin and end tags containing a title.
• <title>...</title> title begin and end tags containing a title made up of 32 random characters.
• <body>...</body> body begin and end tags containing anywhere from 5 to 10 randomly selected content items from
“junk.txt”, along with links to 3 other randomly selected pages in the link farm.
• <a href="pageX.html">pageX.html</a> anchor to link to other pages in the link farm.
• <BR> to insert blank lines.



In my opinion, the hardest part of this sounds like generating the links.

The pages form the nodes of a directed graph. I would generate an adjacency list (or matrix, if you prefer) directly. You could then walk the adjacency list and insert your links into each page.

If you have a page skeleton which doesn't change, split it into a "beginning" and an "end" (the matching close tags). Write the beginning, write your content, and write your links, then write the "end". Assume the validity of whatever you insert.
Last edited on
Topic archived. No new replies allowed.