[edit]I know this is a little late but...[/edit]
>>I am using Visual Basic C++ 2010 if that helps
Here is your problem. There is no such thing as "Visual Basic C++". It's either Visual Basic or Visual C++. Is your class using the Basic or C++ language that is included with Visual Studio? The code you posted looks more like Basic than C/C++.
C/C++ doesn't have all the extra "fluff" keywords that Basic and pseudocode do. Everything has meaning and is short and to the point.
if (score >= 90) then
grade = ‘A’ ;
else if (score >= 80)
set grade = ‘B’;
else if (score >= 70)
set grade = ‘C’;
else if (score >= 60)
set grade = ‘D’;
else
set grade = ‘F' ;
end if // end if score >= 55
end if // end if score >= 65
end if // end if score >= 75
end if // end if score >= 85
There is no "then" or "end if" in C++, the if statement is simply "if" followed by either a single statement or a statement block:
//if with single statement
if (condition)
statement;
//if with statement block:
if (condition) {
statement1;
statement2;
statement3;
//etc...
}
>>I have entered in float score
Sounds like you have it right. In C/C++ there is no "dim" or "declare" statement. Again, short and to the point:
//declare a float variable called score
float score;
In C/C++, the word "set" does not mean assignment, it means something different. When performing assignment, you state the variable name and the new value:
//assign the integer value 15 to the integer variable someNum
int someNum; //declare an integer called "someNum"
someNum = 15; //assign the value 15 to "someNum"
>>I am still getting the same errors saying that A, B, C, D, F are undeclared?
Would have to see your current code to know what you did to cause this...
Fbody
Posting Maven
2,930 posts since Oct 2009
Reputation Points: 833
Solved Threads: 393
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944