CPS 3525 project 2 demo - C++, file I/O, recursion, HTML FORM & cgi using GET method
Using a C++ program to do the followings
  1. Receive two kinds of inputs:
    1. Must use HTML FORM GET method.
    2. Web inputs from browser including two text areas, web sample page is here), the following are the web requirements:
      1. 1st object text data area: a textarea, 20 cols, and 15 rows
      2. 2nd object text data area: a textarea, 20 cols, and 15 rows
      3. a button to upload a text file - the 2nd object text data
      4. Click here to see sample files and details.
  2. Show corresponding error message in red color under each entry in the output,
  3. record client's information (IP, browser, OS, etc), the timestamp that the cgi program was executed.
  4. Here is the details of the input object data:
    1. The data should have two parts - header (first row) and data (after the first row).
    2. The header is the first row and it should have two numbers separated by a comma. The first number is the height (number of records), and the 2nd number is width (number of characters). Every data row should have the same number of char.
    3. 'B' means the background char, 'T' means the target char (object).
    4. You cannot hardcode the width and height in the program. The size of the array should be flexible.
    5. sample file 1
    6. sample file 2
    7. sample file 3
  5. Must implement your own recursive method in C++, and call it from your project.
  6. You must use C++, not any other languages for the backend program.
  7. Use the same recursive method to process the input object data
    1. use the 4-connected method - that means if a 'T' char is connected with its immediate neighbor (left, up, right, down) that is also a 'T', they are considered the same object.
    2. In the sample file, the first object starts at (1,1) with size=2, 2nd object starts at (5,1) with size=1, the 3rd object starts at (3,3) with size=4. There are three 4-connected objects based on the 'T' char.
    3. recognize the number of objects,
    4. count the size of each object for each input
    5. report the visiting details in correct order
  8. identify which input (1st or 2nd textarea) has more objects and the object size,
  9. save these information to a text file,
    1. First line: course id and YOUR name.
    2. 2nd line: the current local time in the format yyyy-mm-dd hh:mm:ss
    3. Show the web inputs, each web input is one line, and the validation error should be under each input
    4. A separated line to separate web user information from the results
    5. The 1st area and the 2nd textarea should have its own result. For each result:
      1. There is a header to show the object text data source (Web or file)
      2. Indicate the width and height
      3. Display the original input object text data
      4. Display the visiting details
      5. For each object, display the sequence #, starting position and size
      6. Display the number of objects
    6. Display which source has more objects and the size
  10. display the output text file html link on the browser.

Note: Your program should:
  1. have good coding style - comments, indentations, meaningful variable names
  2. minimize the global variables
  3. modularize the program
  4. reduce the redundant codes
  5. improve the performance

Project 2 demo page
Paste the object text:
The 1st object:
  The 2nd object: