• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Easy INTRODUCTORY Comp. Sci (C language) questions...or other pop culture questions?

schizoid

Banned
I'm gonna play "Intro to CS Jeopardy" in the lab that I teach next week. I'm going to have categories like "Going Loopy" (about loops) and one called "The Pen is Mightier" (where the students have to come up to the white board, with the pen, and write me some code).

I need other questions and categories that a student midway though introductory C could answer. Any ideas? They've covered pointers, user-defined functions, loops, if statements and basic I/O. No arrays or structs yet.

Anyway, if you have any suggestions, I'd love to hear them. Also, I need some "bonus" questions about current pop culture that your average 18 year old would know.

Thanks!
 
Originally posted by: gopunk
have 'em code something that'll make the fibonacci sequence

and something that does exponentiation

Derrr...it's like Jeopardy. So I need questions. Like, that can be answered quickly and verbally.
 
Prints the ASCII value of a character, or, stars Adam Sandler as the boy who won't grow up.

What is typecasting?
 
Originally posted by: gopunk
have 'em code something that'll make the fibonacci sequence

and something that does exponentiation
Fibonacci's sequence was simple to program before you learn recursion, then it becomes even simpler. :beer:
 
Originally posted by: techfuzz
How about Select/Case statements, variable scopes, or inheritence/polymorphism?
"Scope it Out!" cheesy enough for a category? 🙂

Scope is a good one, a tough one to hit them with is variable hiding

int foo ;

main ()
{
foo = 100 ;
bar() ;
}

void bar()
{
int foo ;

// what is the value of foo right here?

}


 
:Q OMG a serious post from schitzoid.

*faints*

How about some kind of infinite loop detection? It would be yes/no for an answer, but you could make it harder as the questions progress.

For instance, is this an infinite loop?


// Set value1 to a random number, and value2 to a different random number.
const int range = 3
bool flag = true;
int value1;
int value2;

value1 = RAND(range); // get a random int in range

while (flag)
{
value2 = RAND(range);
if ( value1 != value2 )
{
flag = false;
}
}
 
Originally posted by: Marauder911
Originally posted by: gopunk
have 'em code something that'll make the fibonacci sequence

and something that does exponentiation
Fibonacci's sequence was simple to program before you learn recursion, then it becomes even simpler. :beer:

i never said they were hard... my understanding is that this is just some game for a bunch of students halfway through intro to programming
 
Originally posted by: schizoid
Originally posted by: gopunk
have 'em code something that'll make the fibonacci sequence

and something that does exponentiation

Derrr...it's like Jeopardy. So I need questions. Like, that can be answered quickly and verbally.

what happened to the pen is mightier section?
 
Back
Top