Thread: Need exercises for my students tonight...

  1. #1
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765

    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
    The knack of flying is learning to throw yourself at the ground and miss.

  2. #2
    Wen Resu
    Join Date
    May 2003
    Posts
    219
    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. #3
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    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. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Sort an array.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    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. #6
    Bios Raider biosninja's Avatar
    Join Date
    Jul 2002
    Location
    South Africa
    Posts
    765
    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.

  7. #7
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    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

  8. #8
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    >>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

  9. #9
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    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

  10. #10
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    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

  11. #11
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    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. #12
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C program using structs to calculate grades
    By TampaTrinDM88 in forum C Programming
    Replies: 4
    Last Post: 07-06-2009, 12:33 PM
  2. realloc segfaults.
    By noobcpp in forum C Programming
    Replies: 24
    Last Post: 11-26-2008, 01:16 AM
  3. seeking for exercises
    By smoking81 in forum Linux Programming
    Replies: 7
    Last Post: 09-14-2008, 06:46 PM
  4. new problem with class
    By jrb47 in forum C++ Programming
    Replies: 0
    Last Post: 12-01-2006, 08:39 AM
  5. IEEE Society for Students
    By Ben_Robotics in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 06-26-2003, 08:53 AM