Question: Please use C language: I am looking for solution of Assignment 3. To solve assignment 3, we need some instructions from assignment 2 as well.

Please use C language:

I am looking for solution of Assignment 3. To solve assignment 3, we need some instructions from assignment 2 as well. So I have attached instruction from Assignment 2 as well. The first question is of assignment 3:

1.

Develop and test a new version of the utility program from Assignment 2 for examining the HTML tags in HTML files, called htags2. The program inputs and analyses an HTML file and prints of the list of the HTML tags names together with the number of occurrences of each tag (printout exactly as in Assignment 2). Use the same simplified definition of the HTML tag names given in Assignment 2.

The new utility program htags2 should read the HTML file specified as the command line parameter, for example to run your program on A3.htm use:

$ ./htags2 A3.htm The new version should read the entire HTML file into a character array, called here the input array. This input array is the only data structure for storing text, i.e. strings of characters, in your new program. The new implementation must not store the HTML tags directly in a separate data structure (array). Instead, htags2 should use pointers stored in the index table, pointing to the first occurrence of each tag identified in the input array. A separate (parallel) array of integers should then be used to keep track of the number of occurrences of each identified tag type. Here are the new requirements for the implementation of htags2:

Read the file specified as the command line parameter and output the count for each HTML tag detected.

Your program must consist of at least TWO programming modules, with at least one of them compiled and tested separately.

The new version of the htags2 program is to be implemented using pointers ONLY to access array elements. The square brackets [ and ] can be used to specify the array dimensions ONLY. In all other cases you must use pointers.

Only one char array, the input array, can be used to store the text from the entire input HTML file.

You are not allowed to store the detected tags in a char array: you must use the index table to store pointers to the tags detected in the input char array.

Assume the input file contains less than 100000 characters.

Assume there are less than 100 different tag types in the HTML file.

Put comments in your code.

The assignment submission should consist of the following parts:

1. In a few sentences describe the design of your program. Focus on the description of the programming modules (procedures) and the data structures needed to complete the task.

2. Show the complete source code of every programming module.

3. Show the testing of one of the modules (report on testing of just one of the modules).

4. Show the gcc compiler statement used to compile all the modules into the single executable.

5. Show the output from running your program on the following text: TEST

6. Show the output from running your program on this HTML file, i.e. the very file, A3.htm, describing this assignment.

2. This is Assignment 2 question:

Processing strings, arrays

Develop and test a utility program called htags that analyses an HTML file and prints of the list of the HTML tags names together with the number of occurrences of each tag. Use the following simplified definition of the HTML tag names:

The tag name starts immediately after the < character, and consists of one or more non blanc characters other than / and is terminated by either the space character or by the > character. For example, in the sample excerpt of the html file:

CS 2263

Assignment 1

we find the body and div tags occurring only once, and the p, b and span tags occurring twice each. Note that /span, /b and /p are not counted as tags. The data to your program should be read from the standard input (use the input redirection to read the entire HTML file). Print one tag name, followed by the tag count, per line. Put comments in your code. The assignment submission should consist of the following parts:

1. In a few sentences describe the design of your program. Focus on the description of the programming modules (procedures) and the data structures needed to complete the task. (Note: use arrays to store the tags. You may restrict your solution to the maximum of 100 tags, and each tag to be less than 10 characters long.)

2. Show the complete source code of every programming module.

3. Show the testing of one of the modules (report on testing of just one of the modules).

4. Show the gcc compiler statement used to compile all the modules into the single executable.

5. Show the output from running your program on the following text: TEST

6. Show the output from running your program on this HTML file, i.e. the very file describing this assignment.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!