Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,117 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,785 people online right now. Registration is fast and FREE... Join Now!




Need help aligning program and calculating rows

 
Reply to this topicStart new topic

Need help aligning program and calculating rows, Stuck

hollsmeags
17 Apr, 2007 - 04:38 PM
Post #1

D.I.C Head
**

Joined: 29 Mar, 2007
Posts: 87


My Contributions
/* 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
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Need Help Aligning Program And Calculating Rows
17 Apr, 2007 - 06:19 PM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
What error message are you receiving?
User is offlineProfile CardPM
+Quote Post

hollsmeags
RE: Need Help Aligning Program And Calculating Rows
18 Apr, 2007 - 04:07 AM
Post #3

D.I.C Head
**

Joined: 29 Mar, 2007
Posts: 87


My Contributions
Sorry, I left that out


The error is
no matching function for call to `std::basic_ifstream<char, std::char_traits<char> >::get(int&)'

Thanks!

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 09:57PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month