Oh I stupid I missed something:
Code:void Initialize(bool failing[]) ; void SetFailing(bool failing[],const int score[]) ; void SetPassing(bool passing[],const int score[]) ;
Oh I stupid I missed something:
Code:void Initialize(bool failing[]) ; void SetFailing(bool failing[],const int score[]) ; void SetPassing(bool passing[],const int score[]) ;
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
I get 23 errors and 1 warning when I add those semicolons to the three statements.
Bryan
I'm not doing so good today:
Any idea what that should be?Code:int score [NUM_STUDS};
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
scores for 100 students....since the NUM_STUDS=100 above..at least I hope..hehhe
"if they want me to initialize all compoenets of failing to false, what exactly am I trying to do? I dont specify in this program what is passing or failling, that is a totally differenet program, and I kow if I did I would put >=60 ..stuff like that, but what exactly am I trying to find? that is what I dont understand..."
If you were instructed to created a 15 element integer array in main(), and then call a function to set each of the elements to the number 5, could you do that? I suggest you try to do that as an exercise.
When you declare an array like this:
int numbers[15];
the compiler sets aside space in memory for 15 integers. As an exercise, after declaring the above array, you should try displaying each element doing this:
If you do that, you will discover that each element contains a junk value. Therefore, typically programmers "initialize" their arrays with some value like 0 for instance.Code:for(int i = 0; i<15; i++) cout<<numbers[i]<<endl;
In your case, your array is of type bool. A variable of type bool can have one of two values: true or false. For instance,
bool my_variable = false;
or
bool my_variable = true;
and an array of type bool like,
bool my_array[10];
is made up of elements my_array[0], my_array[1], ....my_array[9] which are all of type bool. Your instructions are to create an array of type bool and call a function to initialize every element of the array to false. That means you have to create the array in main(), send it to the function, and inside the function set each element to false, like this:
my_array[0]=false;
....
etc.
YOu shouldn't be worrying about the scores at this point, and when you do incorporate the scores you should create a file with 3 scores and get that to work before trying a file with 100 scores.
Finally, based on your inability to see the glaring syntax error the previous post tried to point out, I am going to surmise that this program is way over your head. You have to be able to successfully program and debug simple hello world type problems with only a few lines of code before trying bigger programs or you won't be able to figure out what's wrong. For instance, things like semi-colons at the end of statements are not optional in C++.
Good luck.
Last edited by 7stud; 08-01-2003 at 09:15 PM.
I wish I had a choice...I am just trying to do my assignemnts every week. Its a learning experience and since I do this online its alot harder not having a teacher help explain it to me. thanks for all the input though.
This assignment is due in 35 min. Otherwise I get a late point, would someone just highlight where I need to focus on so I can find a way to chage that part of the program. I know people dont like just giving answers becuase that is not helping anyone but I just need to get this done and it also helps me learn by looking over what I did and learning from the errors. If not, thats cool, thanks anyways.
Bryan
also, I added those three semiclons back and fixed the void statement that had aI needed aCode:}...I messed up.Code:]