Program 3

HTML File Processing

due Thursday, March 9th by the start of lab

Lab Partners

Everyone is encouraged to work with one lab partner (who is in the same lab section as yourself) on this assignment. If you do work with a partner, submit one solution with both of your names on it. Also, please look at the class collaboration policy so that you know what is and what isn't allowed.

General Overview

Write a Java program that prompts the user for the name of an html file that is located in the same directory as the Java project. The program should print each html tag that occurs in the file in alphabetical and state how many times the tag occurred.

Purpose

The purpose of this assignment is to give you experience with file input and sorting.

sample.html file


<html>

<head>
<title>Sample File</title>
</head>

<body>

<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>

</body>

</html>

Sample Run

Please enter the name of a file: sample.html

HTML tag analysis for sample.html

tag			count
---                     -----
body 			    1
head 			    1
html 			    1
li 			    2
ol 			    1
title 			    1

Requirements and Grading

What to Submit

E-mail your code to your lab TA in one message. The subject of the message should be: CS221-xx program3 your-names. The xx is the number of your lab section. Your lab TA must receive your e-mail by the start of your lab period on the date on which the assignment is due. Otherwise there will be a 25 point per day late penalty.