Is this even fair?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Is this even fair?

Post 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?
User avatar
Don Pwnious
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 833
Joined: Tue Jun 15, 2004 5:32 pm
Location: on the streets wit my j23
Contact:

Post by Don Pwnious »

MAn that is unfair . :twisted: :evil:
you should correct the teacher on her wrong doings.
1/8th time- 14secs
1/8th speed - 110mph
User avatar
Don Pwnious
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 833
Joined: Tue Jun 15, 2004 5:32 pm
Location: on the streets wit my j23
Contact:

Post by Don Pwnious »

really??
1/8th time- 14secs
1/8th speed - 110mph
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post 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.
Last edited by JS Lemming on Fri Sep 17, 2004 3:43 pm, edited 1 time in total.
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
Post Reply