Society of Robots - Robot Forum
Software => Software => Topic started by: vipulan12 on November 10, 2013, 10:51:49 PM
-
why am i getting this error in eclipse?
cannot open output file C++ tutorial exe: permission denied
here is code(sorry it isn't commented):
#include <iostream>
using namespace std;
int average1;
int readMark()// reads the individual marks
{
cout<<"Enter you mark"<<endl;
int x;
cin >> x;// reads mark
return x;
}
int grade()
{
int a = (readMark());
int b = (readMark());
int c = (readMark());
int d = (readMark());
int e = (readMark());
int f = (readMark());
int g = (readMark());
int h = (readMark());
int average = ((a+b+c+d+e+f+g+h)/8);
average1 = average;
return (average);
}
int display(int average)// displays the average
{
cout << "your average is "<<average<< endl;// prints the average
return average;
}
void convertToLetterGrade()
{
if ( average1 < 50)
{
cout<< " Your mark is a R"<< endl;
}
else if ((average1 >=50) && (average1 <=59))
{
cout<< " Your mark is a D"<< endl;
}
else if ((average1 >=60) && (average1 <=69))
{
cout<< "Your mark is a C"<< endl;
}
else if ((average1 >=70) && (average1 <=79))
{
cout<< " Your mark is a B"<< endl;
}
else if ((average1 >=80) && (average1 <=100))
{
cout<< "Your mark is a A"<< endl;
}
}
int main()
{
string answer;
do
{
display(grade());
convertToLetterGrade();
cout << "Do you wish to use this program again?" << endl;
getline (cin,answer);
}
while(answer=="yes");
return 0;
}
-
The program is probably still running. You can't overwrite a running program.
Btw: This site is about robots, not C++ development in mingw. You may want to find a forum that specializes in those tools for faster/better answers!
Second btw: If you're developing on Windows, you really ought to download and use the free version of Visual C++ Express. It's a much better development environment for C++ on Windows than Eclipse and mingw (or any of the other free options like code::blocks.)
-
okay, thanks for the input