fatal error: iostream: No such file or directory
Code:
#include <iostream>
using namespace std; //Added
//
#include <iomanip>
int main()
{
int product, quantity;
double total = 0.0;
// display headers
cout << "Enter pairs of item numbers and quantities."
<< "Enter -1 for the item number to end input.\n";
cin >> product;
while ( product != -1 )
{
cin >> quantity;
switch ( product ) // switch statment nested in while
{
case 1:
total += quantity * 2.98;
break; // necessary to exit switch
case 2:
total += quantity * 4.50;
break; //exit switch
case 3:
total += quantity * 9.98;
break; // exit switch
case 4:
total += quantity * 4.49;
break; // exit switch
case 5:
total += quantity * 6.87;
break; // exit switch
default: // catch all other characters
cout << "Invalid product code: " << product
<< "\n Quantity: " << quantity << '\n';
break;// optional; will exit switch anyway
} // end switch
cout << "Enter pairs of item numbers and quantities.\n"
<< "Enter -1 for the item number to end input: ";
cin >> product;
} // end while
cout << setiosflags( ios::fixed | ios::showpoint )
<< "The total retail value was: " << setprecision( 2 )
<< total << endl;
return 0; // indicate successful termination
} // end function
i get "C:\Users\Yeoh Wei Liang\Documents\online retailer sells\Untitled2.c|1|fatal error: iostream: No such file or directory|"
when i compile my program.
Help me...