Computer Science 202 Programming Assignment 5 Assigned: April 7, 1999 Due: April 23, 1999 This assignment is similar to Programming Assignments 3 and 4 . However, I want you to solve the problem using trees. You may also use stacks and queues if they can help you any. 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. Given an indented input file, produce a set of HTML files corresponding to the file. When this option is selected, ask the user for the name of input file. You will also tell the user how many of the HTML files are "under construction". 2. Quit the program. Samples of input and output files are given below. Given an indented text file, produce a set of HTML files 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: test1.txt 3 Data Structures Homogeneous Heterogeneous Arrays Linked Lists Algorithms Sorting Searching Graph Theory of Computation Upper Bounds Time Space Lower Bounds Output Files: test1.html: TheoryofComputation.html:
Theory of Computation

Up: Root DataStructures.html:

Data Structures

Up: Root Arrays.html:

Arrays
This file is under construction.

Up: Data Structures Heterogeneous.html:

Heterogeneous
This file is under construction.

Up: Data Structures Homogeneous.html:

Homogeneous
This file is under construction.

Up: Data Structures LinkedLists.html:

Linked Lists
This file is under construction.

Up: Data Structures Algorithms.html:

Algorithms

Up: Root Graph.html:

Graph
This file is under construction.

Up: Algorithms Searching.html:

Searching
This file is under construction.

Up: Algorithms Sorting.html:

Sorting
This file is under construction.

Up: Algorithms UpperBounds.html:

Upper Bounds

Up: Theory of Computation LowerBounds.html:

Lower Bounds
This file is under construction.

Up: Theory of Computation Time.html:

Time
This file is under construction.

Up: Upper Bounds Space.html:

Space
This file is under construction.

Up: Upper Bounds 10 HTML files are "under construction". 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
        must be placed in the output file in alphabetical order. In each HTML file that you generate, you will have at most 6 links to HTML files in a list, and at most one link to a parent file ("Up" link).