Re: [Dev-C++] Newbie: Error in IOSTREAM declaration
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2003-09-29 16:20:13
|
How do you spell the reserved word 'include'?
Exactly what the compiler said: it didn't recognized the word immediately
after the hash character.
/Per W
On Mon, 29 Sep 2003, Opacki, Joseph wrote:
> I'm new to this, can someone help we pinpoint the error?
>
> Thanks...Joe
>
> ***ERROR***
> 2 C:\compile\compile.cpp:3 invalid preprocessing directive
> #inlcude
>
> ***CODE***
> // program to compute bill for either a wholesale or retail purchase
> #include <iostream>
> #inlcude <cstdlib>
>
> using namespace std;
>
> const double TAX_RATE = 0.05; // 5% sales tax
>
> int main()
> {
> char salesType, ans;
> int number;
> double price, total;
>
> do
> {
> cout << "Enter price $";
> cin >> price;
> cout << "Enter number purchased: ";
> cin >> number;
> cout << "Type W if this a wholesale purchase.\n"
> << "Type R if this a retail purchase.\n"
> << "Then press Return.\n";
> cin >> salesType;
>
> if ( (salesType == 'W') || (salesType == 'w') )
> {
> total = price * number;
> } else if ( (salesType == 'R') || (salesType == 'r') )
> {
> double subtotal;
> subtotal = price * number;
> total = subtotal + subtotal * TAX_RATE;
> } else
> {
> cout << "Error in input" << endl;
> }
>
> cout.setf(ios::fixed);
> cout.setf(ios::showpoint);
> cout.precision(2);
>
> cout << number << "items at $" << price << endl;
> cout << "Total Bill = $" << total;
>
> if ( (salesType == 'R') || (salesType == 'r') )
> {
> cout << " including sales tax.\n";
> }
>
> cout << endl << "Would you like to try again (Y or N)? ";
> cin >> ans;
> cout << endl;
> } while (ans == 'y' || ans == 'Y');
>
>
> system("pause");
> return 0;
> }
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|