This is what I want it to do;
Create a studentgrades class, including the three arrays (std::string courses[5] = { "Mathematics","Swedish","English","History","Physics" };
int score[5];
char grade[5];)
Create 5 objects -> Have user input their scores for the 5 subjects they all study -> Convert the score to letter grades -> Print Every object with their scores and grades for each subject so that its clear whose score and grade belongs to whom and to which subject!
I hope that clears everything up. Thanks for your patience, I know Im really lost on this one :-)
What I mean is that you you're trying to access the arrays (lines 29/30/35) as if they were defined in main, but the actually aren't.
I think you are confused about the 5. You have 5 courses and 5 studends, but they are not related. As far as I understand it: Each studends has 5 courses.
Haha oh sorry, silly mistake. Get a bit blind after a while. :P
There's no bugs in the code now but I can't get it to work properly, am I calling the functions incorrectly? Or did I mess something else up?
When I run it the program is just blank and then exits "successfully".
When I run it the program is just blank and then exits "successfully"
In main(), void Input(); and void Output(); are simply declarations. It tells the compiler that those functions exist - somewhere. It doesn't matter whether they do really exist or not, since the functions are never actually called anywhere.
In fact what I think you want to do is to call the member functions of the Student class. You'd do that by calling the function on an existing Student object, for example:
Thanks again! I put it like you said but for some reason I got the "error: expected initializer before '.' token" on all the rows with the student object.input and .output.
This is meaningless - and invalid C++. Why are you putting that "void" in there? You're not declaring or declining the return value of the method (you've already done that in your class definition), so it's meaningless to have that there.
If this is confusing you, you might need to go back to your textbook and familiarize yourself with how to call functions. It's an absolutely fundamental part of C++ (and C, for that matter), so you really should make sure you understand it.
Ah ups, well I sure do need to study a lot more and I am, just started programming with separate files so still figuring things out. Thanks for the pointer!
Program is working quite fine now! Will try to evolve it from here on my own as a project. :-)
Thanks for all your help, especially thanks to you Chervil! Lifesaver. :)