Computer Science 202 Programming Assignment 3 Assigned: February 20, 1998 Due: March 6, 1998 I'm sure that all of you have used the World-Wide Web. Web pages are written in a language called HTML (Hyper Text Markup Language). Your programming assignment lets you work with simple HTML files. Display a main menu of options from which the user may select again and again in any order. If the user doesn't select a correct option, make the user select again. The options are as follows: 1. Display how a given HTML file would look in some form of browser. The HTML file will consist of zero or more ordered and/or unordered lists. When this option is selected, ask the user for two file names: an input file containing the HTML commands, and an output file where the formatted text will be stored. The
    and
tags are used to open and close ordered (numbered) lists, and the tags are used to open and close unordered lists. 2. Given an indented input file, produce the HTML file corresponding to the file. When this option is selected, ask the user for two file names: an input file, and an output file where the HTML output will be stored. Samples of input and output files for each option are given below. Part 1: Sample HTML file:
  1. Mathematics
  2. Computer Science
  3. Physics
  4. English
  5. Foreign Language
  6. Computer Engineering
  7. Electrical Engineering
  8. Geology
Output: 1. Computer Engineering 2. Computer Science * Faculty * Staff * Students 1. Alumni 2. Current 3. Inactive 3. Electrical Engineering 4. English 5. Foreign Language 6. Mathematics 7. Physics If the input file is not valid HTML (i.e., a list is not terminated correctly, there are too many tags, or tags don't match up properly), give the user an error message indicating which line of the file caused the problem. Part 2: Given an indented text file, produce an HTML file which will give a similar effect. The first line of the file contains a number indicating the number of spaces in an indentation unit. Sample Input File: 3 Data Structures Algorithms Theory of Computation Upper Bounds Time Space Lower Bounds Output: By now, you may have noticed that this assignment looks very similar to your first assignment this semester. It is. What is the difference? The difference is that in your output files, the order of the
  • 's is changed. The
  • 's corresponding to each
      or
    tags, or tags don't match up properly), give the user an error message indicating which line of the file caused the problem. Part 2: Given an indented text file, produce an HTML file which will give a similar effect. The first line of the file contains a number indicating the number of spaces in an indentation unit. Sample Input File: 3 Data Structures Homogeneous Heterogeneous Arrays Linked Lists Algorithms Sorting Searching Graph Theory of Computation Upper Bounds Time Space Lower Bounds Output: