hello all, having a slight problem trying to solve this, using visual studio 2010....i have to write a structure that stores a students name, id, 3 test scores, figure out the average grade and overall i.e. if the average is 92 then an a, 87 an b, etc. ill post the code, then the errors to follow
Error 1 error LNK2001: unresolved external symbol _mainCRTStartup C:\Documents and Settings\allisa\my documents\visual studio 2010\Projects\course grades\course grades\LINK course grades
Error 2 error LNK1120: 1 unresolved externals C:\Documents and Settings\allisa\my documents\visual studio 2010\Projects\course grades\Debug\course grades.exe course grades
3 IntelliSense: identifier "test1" is undefined c:\documents and settings\allisa\my documents\visual studio 2010\projects\course grades\course grades\course grades.cpp 58 15 course grades
(the same for test2 and test3)
6 IntelliSense: identifier "avg" is undefined c:\documents and settings\allisa\my documents\visual studio 2010\projects\course grades\course grades\course grades.cpp 59 8 course grades
7 IntelliSense: a value of type "const char *" cannot be assigned to an entity of type "double" c:\documents and settings\allisa\my documents\visual studio 2010\projects\course grades\course grades\course grades.cpp 60 13 course grades
7 IntelliSense: a value of type "const char *" cannot be assigned to an entity of type "double" c:\documents and settings\allisa\my documents\visual studio 2010\projects\course grades\course grades\course grades.cpp 60 13 course grades
Error 1 error LNK2001: unresolved external symbol _mainCRTStartup
It seems you've selected the wrong project type. Try creating the project again, but this time select "Empty Project".
3 IntelliSense: identifier "test1" is undefined c:\documents and settings\allisa\my documents\visual studio 2010\projects\course grades\course grades\course grades.cpp 58 15 course grades (the same for test2 and test3)
This is due to this line:
s-> avg = (test1 + test2 + test3)/3;
You're missing s-> in front of test1, test2, and test3. Same thing for all the instances of avg in your if statements.
7 IntelliSense: a value of type "const char *" cannot be assigned to an entity of type "double"
This error is self-explanatory. You can't do something like s-> gpa = "A"; when gpa is a double. If all you want to store is the letter grade then I suggest that you make gpa a char instead.
thank you, and that resolved about 95% of my problems. i know have 5 errors, all repeats of the number 7 above, just changed to that const char cannot be of type char
Hi, I have a question very similiar to this one. I'm given an assignment to create a student grade structure, and calculate the numeric grades and letter grades.
And the part I'm having trouble with is that, we are also asked to used a function to catch duplicate student ID. i.e. if one ID has been entered already, we'd tell the user to try another.
Here is what I have done so far:
#include <iostream>
using namespace std;
struct StudentRecord
{
int studentNumber; // as ID
double quiz; // from input
double midterm; // from input
double final; // from input
double average; // calculated and output
char grade; // calculated and output
};
void input2(int index, StudentRecord students[]); // THIS IS MY PROBLEM, I AM CLUELESS ON HOW TO CREATE THE CORRECT DEFINITION FOR THIS, AND ALSO CORRECTLY CALLING IT, SO THE PROGRAM RUNS LIKE IT SHOULD.
//calculates the numeric average and letter grade.
void computeGrade(StudentRecord& student);
//outputs the student record.
void output(const StudentRecord& student);
int main()
{
const int CLASS_SIZE = 2;
StudentRecord studentAry[CLASS_SIZE];
int index;
cout << "Input " << CLASS_SIZE << " students' Data please...\n\n";
for(index = 0; index < CLASS_SIZE; index++)
{