CSC1321 Programming Assignment

Data Processing

Tasks

Write a program to read product inventory data from a data file here and display in web page format. The data processing tasks include:

  1. Write a C++ program to read wine inventory data from the input file line by line (each line represents a wine indventory)
  2. Output the data into a HTML file in tabular format using HTML table tags. A sample of output file is here
  3. View the HTML file in web browser to check if your program reads and outputs data correctly
  4. Calculate inventory value for each product (= Units in Stock x Unit Price) and sum them as the total inventory value of all products
  5. Find out which product (product name) has the most inventory value and its inventory value. A procedure of finding the max value among a list of numbers is given below:
    //Sample code
    
    ifstream inData;
    ofstream outData;
    inData.open("OrderData.txt");
    outData.open("inventory.html");
    
    //Print table header
    outData << "<table border=1>" << endl;
    
    //Read the first product
    inData >> ...
    while(inData)
    {
       //Processing data
       //...
       
       //Read next product
       inData >> ...
    }
    outData << "</table>" << endl;
    

What to submit

Submit both C++ program and HTML output file to Blackboard by the midnight of the due day.