Hey everyone.. I'm having a little problem with something I'm writing for a class.. I'm supposed to use while and a nested IF statement in the solution, but every time I run it I get the following back:
Run-Time Check Failure #3 - The variable 'A' is being used without being defined.
Here's the code:
#include <iostream>
using namespace std;
void main()
{
int TotalAssignments;
char Assignment, A, B, C, D, F;
int GPA;
int Counter=0;
int Sum=0;
cout << "Total number of completed assignments this quarter?\n";
cin >> TotalAssignments;
while (Counter < TotalAssignments)
{
Counter = Counter + 1;
cout << "Assignment grade?\n";
cin >> Assignment;
if (Assignment = A)
{
A = 4;
}
else
{
if (Assignment = B)
{
B = 3;
}
else
{
if (Assignment = C)
{
C = 2;
}
else
{
if (Assignment = D)
{
D = 1;
}
else
{
if (Assignment = F)
{
F = 0;
}
}
}
}
}
Sum = Sum + Assignment;
}
GPA = Sum/TotalAssignments;
cout << "Score average is.. " << GPA << "...\n";
Ideas..? :(