1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sergey [27]
3 years ago
13

This assignment requires you to write a program to analyze a web page HTML file. Your program will read one character at a time

from the file specifying the web page, count various attributes in the code for the page, and print a report to the console window giving information about the coding of the page.
Note that a search engine like Google uses at least one technique along similar lines. To calculate how popular (frequently visited or cited) a web page is, one technique is to look at as many other worldwide web pages as possible which are relevant, and count how many links the world's web pages contain back to the target page.
Learning Objectives
To utilize looping structures for the first time in a C++ program
To develop more sophisticated control structures using a combination of selection and looping
To read data from an input file
To gain more experience using manipulators to format output in C++
To consider examples of very simple hypertext markup language (HTML)
Use UNIX commands to obtain the text data files and be able to read from them
Problem Statement
Your program will analyze a few things about the way in which a web page is encoded. The program will ask the user for the name of a file containing a web page description. This input file must be stored in the correct folder with your program files, as discussed in class, and it must be encoded using hypertext markup language, or HTML. The analysis requires that you find the values of the following items for the page:
number of lines (every line ends with the EOLN marker; there will be an EOLN in front of the EOF)
number of tags (includes links and comments)
number of links
number of comments in the file
number of characters in the file (note that blanks and EOLNs do count)
number of characters inside tags
percentage of characters which occur inside tags, out of the total
Here is an example of a very simple HTML file:

Course Web Page
This course is about programming in C++.
Click here You may assume that the HTML files you must analyze use a very limited subset of basic HTML, which includes only the following "special" items: tag always starts with '<' and ends with > link always starts with " comment always starts with "" You may assume that a less-than symbol (<) ALWAYS indicates the start of a tag. A tag in HTML denotes an item that is not displayed on the web page, and often gives instructions to the web browser. For example, indicates that the next item is the overall title of the document, and indicates the end of that section. In tags, both upper and lowercase letters can be used. Note on links and comments: to identify a link, you may just look for an 'a' or 'A' which occurs just after a '<'. To identify a comment, you may just look for a '!' which follows just after a '' (that is, you do not have to check for the two hyphens). You may assume that these are the only HTML language elements you need to recognize, and that the HTML files you process contain absolutely no HTML syntax errors. Note: it is both good style because readability is increased, and convenient, to declare named constants for characters that are meaningful, for example const char TAG OPEN = ' Sample Input Files Program input is to be read from a text file. Your program must ask the user for interactive input of the file name. You can declare a variable to store the file name and read the user's response Miscellaneous Tips and Information You should not read the file more than once to perform the analysis. Reading the file more than once is very inefficient. The simplest, most reliable and consistent way to check for an end of file condition on a loop is by checking for the fail state, as shown in lectures. The eof function is not as reliable or consistent and is simply deemed "flaky" by many programmers as it can behave inconsistently for different input files and on different platforms. You may use only while loops on this project if you wish; you are not required to choose amongst while, do while and/or for loops until project 4 and all projects thereafter. Do not create any functions other than main() for this program. Do not use data structures such as arrays. You may only have ONE return statement and NO exit statements in your code. You may only use break statements inside a switch statement in the manner demonstrated in class; do not use break or continue statements inside loops. #include // used for interactive console I/O #include // used to format output #include // used to retrieve data from file #include // used to convert data to uppercase to simplify comparisons #include 11 for string class functions int main() { 1 //constants for analysing HTML attributes const char EOLN = '\n'; const char COMMENT_MARK = '!'; const char LINK='A'; //constants to format the output const int PAGEWIDTH = 70; const char UNDERLINE = '='; const char SPACE = const int PCT_WIDTH = 5; const int PCT_PRECISION = 2;
Computers and Technology
1 answer:
sattari [20]3 years ago
3 0

Answer:

bro it is a question what is this

Explanation:

please follow me

You might be interested in
Which is an internet service?<br><br> Antivirus<br> Chat<br> Firewall<br> Router
leva [86]

Answer:

Router

Explanation:

The others are not related to internet per se.

8 0
3 years ago
Read 2 more answers
balance exercises used for introducing balance training should initially involve little joint motion and improve what type of co
liubo4ka [24]

The balance exercises used for introducing balance training should initially involve little joint motion and improve the Reflexive (automatic) joint-stabilization contractions.

<h3>What is the main goal of balance training?</h3>

Balance training is known to be a kind of an exercise where a person that is doing the  exercises works out so as to strengthen the muscles that aids  them to keep to be upright, such as their  legs and core.

Note that  kinds of exercises are done so as to improve stability and help hinder falls.

Therefore, The balance exercises used for introducing balance training should initially involve little joint motion and improve the Reflexive (automatic) joint-stabilization contractions.

Learn more about balance exercises  from

brainly.com/question/16218940

#SPJ1

5 0
1 year ago
Are you allowed to copy and paste answers on brainy to give answers to other people?
Zanzabum
I’m pretty sure you can; or u can also screenshot n send, which is what i usually doooo
7 0
3 years ago
Read 2 more answers
Which statement best describes the problem statement below?
marta [7]

Answer:

B

Explanation:

This problem statement does not clearly define the issues.

7 0
3 years ago
What wireless security technology contains significant flaws and should never be used?
aalyn [17]

The wireless security technology contains significant flaws and should never be used is Wired Equivalent Privacy (WEP).

<h3>What is the primary weakness of Wired Equivalent Privacy WEP )?</h3>

Wired Equivalent Privacy (WEP) is known to be a kind of a security protocol, that is seen in the IEEE Wireless Fidelity (Wi-Fi) standard known to be 802.11b.

Note that the primary weakness of wired equivalent privacy (WEP) is that It functions only on some given brands of APs and as such, The wireless security technology contains significant flaws and should never be used is Wired Equivalent Privacy (WEP).

Learn more about wireless security from

brainly.com/question/25633298

#SPJ1

5 0
1 year ago
Other questions:
  • Paulene is using this table in Word,and she started with the cursor in the box that read “Flavor”. she then hits Alt+End,The the
    7·1 answer
  • Match the software requirements of a server to their purpose
    5·1 answer
  • Upgrading only the motherboard will give some performance improvement to a computer system. Why would the improvement be limited
    14·1 answer
  • Samantha plans an investigation in which she will study a population of animals. Which of these answers best describes the focus
    8·1 answer
  • After reviewing the various types of network connections available, a client chooses a network connection that is considered to
    13·1 answer
  • 4. How can you select non-adjacent cells (i.e. cells that are not all together in one block)?
    5·2 answers
  • Write a Student class in Java which has a name, id_number, year (e.g. 2) and
    9·1 answer
  • Helppppppppppp please
    5·2 answers
  • The address for the website you want to visit is called the browser internet URL World Wide Web
    5·2 answers
  • What are some examples of productions categorized as non-broadcast productions?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!