|
/* I have lots of problems on this one. First,Im getting an error on the while line, not sure why Also, when I ran this before the error, things were not lining up When the file was read , all the numbers and the column headings were whacky Also, how do I go about calculating the reorder point and sum I would love any help on this one!!! */
/* This is a program that reads the inventory file and creates an inventory report. The report is to contain the part number,price,quantity,reorder point, minimum order and order amount. The order amount is calculated when the quantity on hand falls below the order point. It is calculated as the sum of the reorder point and the minimum order less than the quantity at hand
This report should line up, with numbers under each row Inventory Report Part # Price Quanity on hand Reorder Point Minimum Order 0123 1.23 23 20 20 0234 2.34 34 50 50 3456 34.56 56 50 10 4567 45.67 7 10 5 5678 6.78 75 75 25
*/
#include <cstdlib> #include <iostream> #include <fstream> #include <iomanip> #include <cstdlib>
using namespace std; int curCh;
int main(int argc, char *argv[]) {
cout <<" Inventory Report "; cout<< "Part # Price Quanity on hand Reorder Point Minimum Order "; ifstream FileInFile; FileInFile.open ("12text.txt"); if (!FileInFile) { cerr << "Error 100 opening ch7FILE9.DAT"; system("PAUSE"); return EXIT_SUCCESS; exit (100); } // if { while(FileInFile.get(curCh)) { if (curCh != ' ') cout<< curCh; else cout<< "\n"; } FileInFile.close(); system("PAUSE"); return EXIT_SUCCESS; }
This post has been edited by hollsmeags: 17 Apr, 2007 - 04:42 PM
|