Introduction: In this assignment you will be analyzing search queries from various engines.

Introduction: In this assignment you will be analyzing search queries from various engines. (A daunting task, like what does that even mean) In short you will prompt the user for the name of a file,

Introduction:

Don't use plagiarized sources. Get Your Custom Essay on
Introduction: In this assignment you will be analyzing search queries from various engines.
Just from $13/Page
Order Essay

In this assignment you will be analyzing search queries from various engines. (A daunting task, like what does that even mean)

In short you will prompt the user for the name of a file, attempt to open said file, and if succeeded then you will begin to parse and output as follows.Each line will contain one search query (type a search into google and look at the URL, that thing)You are to parse each one for information and output it to a file while also tracking some information about everything you have parsed. (Ok those were some words lets break that down)

In short you will prompt the user for the name of a file, attempt to open said file, and if succeeded then you will begin to parse and output as follows.Each line will contain one search query (type a search into google and look at the URL, that thing)You are to parse each line for certain information, more on that later, and output this information to a file. While doing this you will track some information about the file. (Ok that was alot of words lets break that down)

Explanation:

For each input line: (all examples bellow are reffering to the following query (https://www.google.com/search?q=some+query&oq=some+query&aqs=chrome..69i57j0l5.2991j0j9&sourceid=chrome&ie=UTF-8))

  • You will grab the site that they are querying
    • would be google.com in this case
  • You will grab the query string
    • In this case it would be “some query”
    • Note it is not “some+query” but some query
  • You will grab any options (if there are any)
    • There are many of these in the above query
      • oq=”some query”
      • aqs = “chrome…69i57j0l5.2991j0j9”
      • sourceid=”chrome”
      • ie = “UTF-8”

For the file: 

  • Track the number of queries that were in the file
  • The average number of options (these count all things that are not the query string q)
  • Average length of the query string (just the q parameter)
  • Average length of the url

Output:

The output is split into two parts. The information for each of the individual url will output to a file and the output about the file statistics will be output to standard output (terminal).

Screen Output Example:Statistics for

————————-

Number of Queries:

Average length of URL:

Average length of query string:

Average number of options:

File Output example:.

.

.

:

——————-

URL:

:

:

\n (this should be a blank line just put a newline)

.

.

.

Input:

Ask the user to enter the file name. Here is an example file

.

.

.

Requirements:

  • You must buld a namespace called “helpers” you will define any fuctions that help calculate (like averages) or manipulate (maybe some strings)
    • You are required to have at least two functions in this namespace
      • Calculating averages and maybe putting the spaces in the query string in place of ‘+’ are good canidates
    • You may use more functions than this (and i recommend you do) but you must do the following
      • If the function is a “helper” (see the above explinations about what a helper is) is must be in the helper namespace
      • This will be mentioned bellow but you must document your function
        • Include what the function does and what the parameters are
  • You must build a namespace called “interface” you will define any functions that help you prompt the user / print to file
    • You are required to have at least two functions in this namespace
      • Printing information to the screen (standard input), maybe your final output to the screen would be a good canidate
      • Another would be a function that prints a line and the corsponding “—-” line that will match up with it
    • You may use more functions than this (and i recommend you do) but you must do the following
      • If the function is a “helper” (see the above explinations about what a helper is) is must be in the helper namespace
      • This will be mentioned bellow but you must document your function
        • Include what the function does and what the parameters are
  • All functions must be documented above a prototype
  • Each time a line has “—-” (dashes under it)
    • The dash line must be the same length as the line above it
Order your essay today and save 20% with the discount code: OFFNOW

Order a unique copy of this paper

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
Top Academic Writers Ready to Help
with Your Research Proposal
error: Content is protected !!
Live Chat+1(978) 822-0999EmailWhatsApp

Order your essay today and save 20% with the discount code OFFNOW