If it did you probably don't have write access rights to the directory in question. Where is your project located? What operating system are you using?
The project is located in a folder I have designated just for my coding on my desktop. The OS I have currently is Windows 8. It should have compiled without errors seeing as I had compiled it within the hour before this happened. I added a few lines of code that would loop a certain area of the code if the user designated for it to. I have looked over the lines multiple times and find nothing that should be a problem. Also I have tried removing those lines of code and running it, yet I run into the same problem.
It isn't just a read only file. Also, I cannot place the code into this because it consists of over 38,000 characters and the max on here is 8192. This is a snippet of what I added. It was just the do while loops that I had added.
if (b==1)
{
do
{
cout << "\n+-----Your Selection: Addition------+\n"
<< "| Enter Your Number to Add |\n";
double c, d, sum;
cout << " ";
cin >> c;
cout << "| Enter Your Second Number |\n"
<< " ";
cin >> d;
sum = c + d;
cout << "| The Sum is |\n"
<< " " << setprecision(4) << sum << endl
<< "+-----------------------------------+\n"
<< "\n+-----------------------------------+\n"
<< "| Would You Like to Continue |\n"
<< "| Using Addition? (Y/N) |\n"
<< " ";
cin >> again;
cout << "+-----------------------------------+\n";
} while (again=='y' || again=='Y');
}
if (b==2)
{
do
{
cout << "\n+----Your Selection: Subtraction----+\n"
<< "|Enter Your Number to Subtract From |\n";
double e, f, diff;
cout << " ";
cin >> e;
cout << "| Enter Your Number to Subtract |\n"
<< " ";
cin >> f;
diff = e - f;
cout << "| The Difference is |\n"
<< " " << setprecision(4) << diff << endl
<< "+-----------------------------------+\n";
cout << "\n+-----------------------------------+\n"
<< "| Would You Like to Continue |\n"
<< "| Using Subtraction? (Y/N) |\n"
<< " ";
cin >> again;
cout << "+-----------------------------------+\n";
} while (again=='y' || again=='Y');
}
if (b==3)
{
do
{
cout << "\n+---Your Selection: Multiplication--+\n"
<< "| Enter Your Number To Multiply |\n";
double g, h, prodct;
cout << " ";
cin >> g;
cout << "| Enter Your Second Number |\n"
<< " ";
cin >> h;
prodct = g * h;
cout << "| The Product is |\n"
<< " " << setprecision(4) << prodct << endl
<< "+-----------------------------------+\n";
cout << "\n+-----------------------------------+\n"
<< "| Would You Like to Continue |\n"
<< "| Using Multiplication? (Y/N) |\n"
<< " ";
cin >> again;
cout << "+-----------------------------------+\n";
} while (again=='y' || again=='Y');
}
if (b==4)
{
do
{
cout << "\n+------Your Selection: Division-----+\n"
<< "| Enter Your Number to Divide From |\n";
double i, j, quotent;
cout << " ";
cin >> i;
cout << "| Enter Your Second Number |\n"
<< " ";
cin >> j;
do
{
if(j==0)
{
cout << "| !Error! |\n"
<< "| !Cannot Divide by 0! |\n"
<< "| !Re-Enter Second Number! |\n"
<< " ";
cin >> j;
}
} while (j==0);
quotent = i / j;
if(j != 0)
{
cout << "| The Quotient is |\n"
<< " " << setprecision(4) << quotent << endl
<< "+-----------------------------------+\n";
}
cout << "\n+-----------------------------------+\n"
<< "| Would You Like to Continue |\n"
<< "| Using Division? (Y/N) |\n"
<< " ";
cin >> again;
cout << "+-----------------------------------+\n";
} while (again=='y' || again=='Y');
Also, if you're wondering, everything used is defined. Again is defined as a Char at the beginning of the main.
#include <iostream>
#include <iomanip>
usingnamespace std;
void doAddition()
{
char again;
do
{
cout << "\n+-----Your Selection: Addition------+\n"
<< "| Enter Your Number to Add |\n";
double c, d, sum;
cout << " ";
cin >> c;
cout << "| Enter Your Second Number |\n"
<< " ";
cin >> d;
sum = c + d;
cout << "| The Sum is |\n"
<< " " << setprecision(4) << sum << endl
<< "+-----------------------------------+\n"
<< "\n+-----------------------------------+\n"
<< "| Would You Like to Continue |\n"
<< "| Using Addition? (Y/N) |\n"
<< " ";
cin >> again;
cout << "+-----------------------------------+\n";
} while (again=='y' || again=='Y');
}
int main()
{
doAddition();
return 0;
}
This way you can write each section of the code and troubleshoot it before you add it to the "big picture".
Also if you added all that code before you compiled the program, that is part of the problem. You need to compile often, many times after adding only one line of code. And always fix all warnings before you move to the next addition.
jlb, all I added to it was the do while statements. I had the rest already coded and had been compiled a ton of times considering this is towards the beginning of the rest of what it is capable of. @LowestOne no other build of the program is open or running. I have attempted restarting the program, my computer and have accomplished nothing.