The project is out of date

I use visual studios c++, and whenever I try to run even the most simple program, it says "the project is out of date. Would you like to run?" I click yes, and it says there are build errors, even though there arent.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include<iostream>
#include<string>

using namespace std;

int main()

{

float GPA = 0;
float Grade = 0;
float GradeStore = 0;
int HowMany = 0;

GPA = GradeStore / HowMany;
cout<<"How many Grades do you have?\n";
cin>>HowMany;

while (HowMany != 0)
{
cout<<"What was your grade?\n (One, Two, Three, or Four)\n";
cin>>Grade;
GradeStore = GradeStore + Grade;
HowMany = HowMany - 1;
}

if (GPA > 4)
{
	cout<<"Your GPA is 4.0!\n";
	cout<<"Good Job!\n";
}

else
{
cout<<"Your GPA is "<<GPA<<"!\n";

if (GPA <3.0)
{
cout<<"Thats not very good...\n";
}

else if(GPA >= 3.0)
{
cout<<"Good Job!\n";
}

}


system("Pause");
return 0;
}
You have a divide by zero, so I'd expect it to crash.

What version of Visual Studio are you using? They're not perfect when deciding what to build, so you could have a problem after having done everything correctly.
Topic archived. No new replies allowed.