Thread: Assignments or challenges

  1. #1
    Registered User Dogmasur's Avatar
    Join Date
    Jul 2008
    Posts
    72

    Assignments or challenges

    Hello all,

    I have been slowly teaching myself to program in C and have gone through a number of college-level homework assignments that I Googled online. Now I am having a hard time finding some new assignments to help me continue. I noticed the challenge section on the site hasn't been added to in awhile. Is anyone out there interested in putting out some more challenges or assignments for novice programmers like myself to work on? I can understand if no one is interested, just wanted to ask.
    "The art of living is more like wrestling than dancing." - Marcus Aurelius

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    What sort of challenge would you like [what concepts do you want to cover]?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User Dogmasur's Avatar
    Join Date
    Jul 2008
    Posts
    72
    Anything basic really. I am very new. Basically, when you learned C, how were you taught? Meaning, do you remember what kind of progression you were brought through? I think just about anything would be extremely helpful to me at this point. I am trying to get used to everything at once. Maybe writing a function to perform a task. I am still trying to feel more confident with that. I haven't played with structures yet and I don't think I am ready to.

    Thank you.
    "The art of living is more like wrestling than dancing." - Marcus Aurelius

  4. #4
    Registered User Dogmasur's Avatar
    Join Date
    Jul 2008
    Posts
    72
    Actually, while this is off topic, I thought of another question. Is it true that there is not a way to clear the screen that is accepted by ANSI? I read this in Greg Perry's Absolute Beginner's Guide to C 2nd edition which was written quite some time ago.

    If this in currently incorrect, how does one go about doing it?
    "The art of living is more like wrestling than dancing." - Marcus Aurelius

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Ok, so there's usually a couple of posts (at least) beginners posting more or less complete assignments here. Try solving a few of those.

    And yes, there is no portable way to clear the screen. I personally do not see it as necessary to clear the screen, so just not doing it is one option. The other option is to use a non-portable [that is, non-standard] library function. A third option is to call system("clear") [on Unix/Linux] or system("cls") [on windows]. All have their own benefits and drawbacks - the first method is what I normally use - being able to see what went on before I started the application is often "nice".

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Registered User Dogmasur's Avatar
    Join Date
    Jul 2008
    Posts
    72
    Ok, thank you. I have also been told Windows programming is rather difficult until you have a good grasp of the language. Is this true?
    "The art of living is more like wrestling than dancing." - Marcus Aurelius

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Dogmasur View Post
    Ok, thank you. I have also been told Windows programming is rather difficult until you have a good grasp of the language. Is this true?
    If by "Windows" you mean GUI, yes - that it is necessary to have a good grasp of pointers, address of, how types work (structs, enums, etc) and many other things. Also, even trivial Windows programs tend to be quite a few lines - so being able to work in a slightly larger set of source code is another key point for doing Windows programming.

    Keep to console programs.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    * noops's Avatar
    Join Date
    Jun 2008
    Posts
    108
    How about:

    Take in a string from the user like: This IS juST A stRING! 12369 )(&*

    Convert and print the string as:
    - All upper case
    - All lower case
    - 1st letter of each word upper case

    Don't use string.h

    You will probably want to make functions that will tell you if a character is upper or lower case (or neither, e.g. 1234 (*#9 etc.)
    And maybe a function to change the case of a character.

    I think this is a pretty good exercise.
    Last edited by noops; 08-19-2008 at 02:02 PM.

  9. #9
    Registered User Dogmasur's Avatar
    Join Date
    Jul 2008
    Posts
    72
    Beautiful and thank you. I'll get to work on this right away and see what I can come up with. No, I have not tried anything with structures yet.
    "The art of living is more like wrestling than dancing." - Marcus Aurelius

  10. #10
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    If you do take noops' suggestion, remember to attempt a version that uses <string.h>. You could start by using <string.h>, in which case you may discover that all you actually need to do is implement certain standard library functions.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > Now I am having a hard time finding some new assignments to help me continue.
    - Any number of homework questions here, just to see if you can solve them.

    - Actually helping out here, by posting answers to questions. If you can explain something to someone else, AND have that explanation stand up to scrutiny of others, then you're good.

    - Programming contests (google it)

    - Open source developments. No end of projects on the likes of sourceforge are always on the look-out for coders of all skills.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  12. #12
    Registered User
    Join Date
    Nov 2004
    Location
    USA
    Posts
    516
    Programming contests (google it)
    @Dogmasur
    www.topcoder.com/tc (But this is after you are comfortable with C and C++ and know how to use the Standard Template Library). For now, concentrate on the homework assignments posted on the board, there is no dearth of those. Try solving the exercises given in whatever book you are using to learn C.
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  13. #13
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    But do not post the answer to the homework questions, whatever you do. We do not want to help cheaters.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lego Mindstorm challenges
    By BobMcGee123 in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 09-27-2008, 01:47 PM
  2. Replies: 3
    Last Post: 04-06-2007, 05:10 PM
  3. Program challenges
    By -Prime- in forum Tech Board
    Replies: 2
    Last Post: 10-15-2006, 03:26 PM
  4. C++ programming assignments and tests
    By NeoNite in forum C++ Programming
    Replies: 1
    Last Post: 06-05-2003, 05:41 AM
  5. Embedded assignments
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 08-28-2001, 10:58 AM