Page 1 of 1

Is this even fair?

Posted: Fri Sep 17, 2004 1:57 pm
by Falco Girgis
I just got a quiz back and I have to listen to the teacher lecture about "functions" because I supposedly missed one. I got a 14/15 because of this question...
3)Write a function that returns the sum of three floats
float random_function(float var1, float var2, float var3) {
return var1+var2+var3;
}

4) Assume that any necessary variables have been declared. Write a function call for the created function in number 3.
random_function(var1, var2, var3);
I got minus 1 for number 4. She put an R = before the function. Now she didn't ask to store the variable that it returns. Sure, you'd have to, but that is NOT part of the function call.

So now, no Dance Dance Revolution during C class because of that. (Well, I'm sneaking and typing this right now, so you'd better believe I'll sneak and do that as well :(|): )

What do you think?

Posted: Fri Sep 17, 2004 2:44 pm
by Don Pwnious
MAn that is unfair . :twisted: :evil:
you should correct the teacher on her wrong doings.

Posted: Fri Sep 17, 2004 3:41 pm
by Don Pwnious
really??

Posted: Fri Sep 17, 2004 3:43 pm
by JS Lemming
I got minus 1 for number 4. She put an R = before the function. Now she didn't ask to store the variable that it returns. Sure, you'd have to, but that is NOT part of the function call.
To my knowledge, you are correct. And, you don't have to store it in anything. The below is valid C++ code.

Code: Select all

1;
6;
8;
Edit - Storing it into a variable my have been one of her own standards, but she should have told you first.