This is not a "How to do my Homework" forum, this forum is for CodeBlocks related questions and not for "Programming-Noobs" questions. And your question totally falls into the second category, but apparently you lack enough understanding to realize that, so let me explain some things.
CodeBlocks IS NOT a compiler. This is the most important thing to remember. CodeBlocks is an IDE, basically it is a nice text editor that can USE a compiler. A very important aspect of CodeBlocks is that it uses a Workspace with Projects to operate, without using a Project weird things can happen, you should tell that the person who said to use CodeBlocks without a Project. A Project is not a magical thing that somehow interfers with your program, its just how CodeBlocks works.
Since you are not using a Project CodeBlocks is using more or less a random compiler it found (i don't know the details), because this is a homework project, you probably use CodeBlocks with the bundled GCC compiler. So this is probably your compiler, GCC, version unknown. I don't know what Xcode uses, GCC or clang, but i used MSVC 14.1 with your program, details follow.
Because we are totally in the off-topic area already, lets take a look at your program (btw. both code versions are the same):
This is where i usually stop reading, homework already failed. Namespace std contains very generic and common names, the name is so short, it is not justified to pull all this into global scope.
if ( items_purchased == 0 )
cout << "Come back again soon!";
else
items_purchased is signed, it can also be negative, you don't handle that case properly.
fout << "Author's Name:" << endl
<< "10/31/18" << endl << endl
<< "Total Purchases: $" << setw(6) << fixed << setprecision( 2 ) << total
<< endl
<< "Discounted Total: " << setw(6) << discounted_total << endl
<< "Tax Rate: " << setw(8) << fixed << setprecision (4) << TAX_RATE << endl
<< "Tax: " << setw(6) << fixed << setprecision (2) << TAX_RATE * discounted_total << endl
<< "Shipping: " << setw(6) << SHIPPING << endl << endl
<< "Total Amount Due: $" << setw(6) << amount_owed << endl;
cout << endl << endl << "Author's Name:"
<< endl
<< "10/31/18" << endl << endl
<< "Total Purchases: $" << setw(6) << fixed << setprecision( 2 ) << total
<< endl
<< "Discounted Total: " << setw(6) << discounted_total << endl
<< "Tax Rate: " << setw(8) << fixed << setprecision( 4 ) << TAX_RATE << endl
<< "Tax: " << setw(6) << fixed << setprecision( 2 ) << TAX_RATE * discounted_total << endl
<< "Shipping: " << setw(6) << SHIPPING << endl << endl
<< "Total Amount Due: $" << setw(6) << amount_owed << endl << endl
<< "A copy for your records can be found in prog4_002out.txt."
<< endl;
Do not use std::endl all over the place, this unnecessarily flushes the stream all the time, use a plain \n and flush only at the last operation. This is also totally copy-paste madness, both outputs are the same, just the console output adds an extra line. Extract this into a function that gets a std::ostream as parameter and output the extra line for the console outside of that function.
TL;DRYour code does not compile in MSVC 14.1. The problem is this:
double total,
price,
discounted_total,
amount_owed;
...
for ( int i = 0 ; i < items_purchased ; ++i )
{
cout << "Enter the item price: ";
cin >> price;
total = total + price;
}
This causes a compiler error because total is used uninitialized (looks like MSVC uses stricter rules now, im pretty sure previous versions only emit a warning). Apparently it doesn't cause a compiler error with your compiler but only a warning. This pushes you in the area of undefined behavior. The compiler is free to do total random stuff of its liking. If you are lucky and compile in debug mode the compiler initializes the variables with 0 for you and it works correctly. Or it puts in random crap and you get random results.
Your code is broken, not your compiler.