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
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
The knack of flying is learning to throw yourself at the ground and miss.
Have them write the old palendrom program
like have it input a word and then checks to see if that word is a palindrom
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
Sort an array.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
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?
Remember that my students are beginners, not rocket scientists like us...
The knack of flying is learning to throw yourself at the ground and miss.
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.
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
>>CurrentLetter = CurrentLetter * (-8^(1/2));
Because ^ is XOR. Use pow( ).
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Originally posted by XSquared
>>CurrentLetter = CurrentLetter * (-8^(1/2));
Because ^ is XOR. Use pow( ).P.S They are doing QBasic
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
QBasic doesn't have a ; at the end of the line, so I assumed that it was C.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
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).
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...
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared