# Thread: Need exercises for my students tonight...

1. ## 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

2. Have them write the old palendrom program

like have it input a word and then checks to see if that word is a palindrom

3. 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

4. Sort an array.

5. 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?

6. Remember that my students are beginners, not rocket scientists like us...

7. 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.

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

9. Originally posted by XSquared
>>CurrentLetter = CurrentLetter * (-8^(1/2));
Because ^ is XOR. Use pow( ).
P.S They are doing QBasic

10. QBasic doesn't have a ; at the end of the line, so I assumed that it was C.

11. 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).

12. 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...