Thread: help loll

  1. #16
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Translation:
    Wahhh! You expect me to actually think! You're mean! You won't give me teh codez!!!

    Cya, although I'm sure you'll be back to try again.

  2. #17
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by salmansalman View Post
    ill figur it out myself, cya..
    That's what we want to hear.

  3. #18
    Registered User
    Join Date
    Apr 2008
    Posts
    72
    wgh : i think ur mistaken, i never said write whole program for me.. i can already write that.. i was asking for the line code only for this logic but anywy np.. no one here actually knows how to help but Elysiaa or something.. i forgot his nick but he's a gr8 helper always helped ..

  4. #19
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Listen listen,
    these people really want to help you. Help you to become a great programmer. They do so by making you solve your own problem - by giving you hints an direction, just like a real teacher would.
    Now, I hope you know how to write pseudo code or flow charts?
    I suggest you try. Try to write down the logic in your mind.
    Try to figure out how you would do if someone gave you 3:65:05.
    Let your brain do the work.
    Once you've written a flowchart and pseudo code, you can translate it into actual C++ code. This is the basic step you're taught in programming.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #20
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Code:
    int checkTimeSeconds ( int sec )
    {
       if ( sec > 60 )
       {
          m_Seconds = 10; // default value
       }
    
       else
       {
          m_Seconds = sec;
       }
    
       return m_Seconds;
    }
    Somthing like that.
    Double Helix STL

  6. #21
    Registered User
    Join Date
    Apr 2008
    Posts
    72
    i know whats a flowchart but whats a pseudo code exactly? b tw reply my pm please ;p

  7. #22
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Pseudo code is basically non-language code, such as:

    ASK USER FOR INPUT
    CHECK IF INPUT IS VALID
    IF INPUT IS VALID
    PRINT OUTPUT
    ELSE
    PRINT INVALID OUTPUT

    Usually, it's what you translate flowcharts into. One step closer to code.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #23
    Registered User
    Join Date
    Apr 2008
    Posts
    72
    ah ok thanks, will try :P thanks

  9. #24
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Quote Originally Posted by Elysia View Post
    Listen listen,
    these people really want to help you. Help you to become a great programmer. They do so by making you solve your own problem - by giving you hints an direction, just like a real teacher would.
    Not what he wants to hear. He just wants someone to do his work for him. Has he shown any effort whatsoever?

    Quote Originally Posted by Elysia View Post
    I suggest you try. Try to write down the logic in your mind.
    Try to figure out how you would do if someone gave you 3:65:05.
    Let your brain do the work.
    I actually thought he had already done this in the OP. However, it now seems the exact scenario quoted was likely spoon-fed as a requirement to him prior to arriving here.

  10. #25
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by rags_to_riches View Post
    Not what he wants to hear.
    Well, it worked this time, didn't it?
    Sometimes people on the board are a little too harsh. I know we've all been...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #26
    Registered User Cpro's Avatar
    Join Date
    Oct 2006
    Posts
    149
    Here is what I would do:
    Ex:
    given time: 3:65:00 (hours = 3, minutes = 65)
    should be: 4:05:00 (hours = 4, minutes = 5)

    if minutes > 60
    hours = hours + minutes / 60
    minutes = minutes % 60

    65 % 60 = 5 (the minutes should be this)
    65 / 60 = 1 (add this to the hours) (*Note:must be declared as an int).

    Although there are other ways to do this (and declaring it as an int is probably considered bad practice), this would work.
    IDE - Visual Studio 2005
    Windows XP Pro

  12. #27
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    People are supposed to think for themselves, you know? Not be handed a solution.
    The first thing you learn as a programmer is to be able to translate the logic into program code through pseudo code and flow charts.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed