Need exercises for my students tonight...

Printable View

• 08-21-2003
biosninja
Need exercises for my students tonight...
Hi all.

I need some exercises for my students tonight to keep them busy. We've already gone through the student guide.

they only know how to do if statements, arrays... you know, the basic stuff.

P.S They are doing QBasic
• 08-21-2003
Iamien
Have them write the old palendrom program

like have it input a word and then checks to see if that word is a palindrom
• 08-21-2003
nickname_changed
Get them to make some sort of one-way encription algorithm. Then get them to give me the code of the one that works best :) All I can think of is using negative roots (imaginary numbers) with the letters :)
• 08-21-2003
adrianxw
Sort an array.
• 08-21-2003
nickname_changed
Hey, on that password encryption thing, I just went and tried it, but it wont let me call the sqrt() function on a negative (imaginary) number. BUT I can raise it to the power of a half, ie:

CurrentLetter = CurrentLetter * (-8^(1/2));

But I'm not sure if the above is doing what it should be doing. Anyone know why?
• 08-21-2003
biosninja
Remember that my students are beginners, not rocket scientists like us...
• 08-21-2003
FillYourBrain
I think sorting algorithms are good to teach beginners. Radix is one of the most valuable things I learned in a programming class. Fastest sort out there.

How bout implement a string compare or a string search. Or, given a string, count the number of occurences of the letter 's'. Or, given a string, do a frequency table for all of the letters (I like that one. It can lead to a huffman compression:) although, huffman may be too much for them at the moment.
• 08-21-2003
XSquared
>>CurrentLetter = CurrentLetter * (-8^(1/2));
Because ^ is XOR. Use pow( ).
• 08-21-2003
FillYourBrain
Quote:

Originally posted by XSquared
>>CurrentLetter = CurrentLetter * (-8^(1/2));
Because ^ is XOR. Use pow( ).

Quote:

P.S They are doing QBasic
• 08-21-2003
XSquared
QBasic doesn't have a ; at the end of the line, so I assumed that it was C.
• 08-21-2003
nickname_changed
Ops, my bad, yes he's right it was C, I know the thread was for QBasic but I was just trying it in C (I don't know QBasic).
• 08-21-2003
JaWiB
Lol I was doing that in some code I was writing and couldn't figure out why it wasn't giving the right output...Took me like half an hour to remember the ^ isnt a power operator...:o