Thread: Please Help A Noob Here (plz Im Begging You)

  1. #91
    Registered User
    Join Date
    Mar 2008
    Posts
    14
    marvix or whatever your nick is, this thread is too big and i cant bother to read it all, just paste your problem here again what do u need etc and if i could help i will and take a bath with some cold water as that will help and result in better programing haha just kiding
    im waiting for u to post ur problem here again ok cya

  2. #92
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Just make a flowchart out of what you have... -_-
    People have already given you a solution. Break it down, understand it, make it into a flowchart.
    Then make changes to your chart and translate it into code again.
    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.

  3. #93
    Registered User
    Join Date
    Mar 2008
    Posts
    45
    but so far my format is like this
    Code:
    {
            if ((year/1000)==3)
            { printf("thirty");}
    
            if ((year/1000)==4)
            {printf("forty");}
    
            if ((year/1000)==5)
            {printf("fifty");}
    
            if ((year/1000)==6)
            {printf("sixty");}
    
            if ((year/1000)==7)
            {printf("seventy");}
    
            if ((year/1000)==8)
            {printf("eighty");}
                                                                                                
            if ((year/1000)==9)
            {printf("ninety");}
    
            if (((year%1000)/100)==3)
            {
            printf("three hundrend");
            }
            if (((year%100)/10)==2)
            {
            printf("and twenty");
            }
            if ((year%10)==1)
            {
            printf("one\n");
            }
    }
    how do i break into hundreds?

  4. #94
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I repeat:
    Quote Originally Posted by Elysia View Post
    Just make a flowchart out of what you have... -_-
    People have already given you a solution. Break it down, understand it, make it into a flowchart.
    Then make changes to your chart and translate it into code again.
    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. #95
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    how do i break into hundreds?
    As I noted earlier, I suggested something along these lines instead:
    Code:
    century = year / 100;
    
    if ((century / 10) == 1)
    {
        /* Handle 1000s to 1900s. */
        if (century == 10)
        {
            /* Print "ten". */
        }
        else if (century == 11)
        {
            /* Print "eleven". */
        }
        /* 12 ... 18 */
        else
        {
            /* Print "nineteen". */
        }
    }
    else if (century > 0)
    {
        /* Handle the thousands place. */
        int num = century / 10;
        if (num == 2)
        {
            /* Print "twenty". */
        }
        else if (num == 3)
        {
            /* Print "thirty". */
        }
        /* 4 ... 8 */
        else if (num == 9)
        {
            /* Print "ninety". */
        }
    
        /* Handle the hundreds place. */
        num = century % 10;
        if (num == 1)
        {
            /* Print "one". */
        }
        else if (num == 2)
        {
            /* Print "two". */
        }
        /* 3 .. 8 */
        else if (num == 9)
        {
            /* Print "nine". */
        }
    }
    
    /* Remember to print "hundred". */
    Notice that when you want to handle the decade, pretty much the same code applies, so you may be able to just copy it with some minor editing.
    Last edited by laserlight; 03-28-2008 at 02:53 AM.
    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

  6. #96
    abyss - deep C
    Join Date
    Oct 2007
    Posts
    46
    Quote Originally Posted by lolol View Post
    marvix or whatever your nick is, this thread is too big and i cant bother to read it all, just paste your problem here again what do u need etc and if i could help i will and take a bath with some cold water as that will help and result in better programing haha just kiding
    im waiting for u to post ur problem here again ok cya
    hi lol...lol,
    ah yes, a prettly long thread!!! however, this thread was not started by me
    if you really care to know the problem statement, you could go to the first post of this thread ;-)

    cheers
    maverix

  7. #97
    abyss - deep C
    Join Date
    Oct 2007
    Posts
    46
    Quote Originally Posted by bobbie18 View Post
    how do i break into hundreds?
    you've been answered on this a number of times.
    Code:
    hundreds = number/100;             // for 1782, you'll get 17
    cheers
    maverix

  8. #98
    Registered User
    Join Date
    Mar 2008
    Posts
    45
    thx a lot for the replies guys
    ........ internet from down under...
    didnt c the answers until now

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can any1 plz make this assignment
    By jean in forum C Programming
    Replies: 17
    Last Post: 05-13-2009, 09:19 PM
  2. The ultimate noob lol...plz help
    By thatpkrguy in forum C++ Programming
    Replies: 14
    Last Post: 11-10-2005, 06:53 PM
  3. plz help here, noob actually .D
    By BjoRn3n in forum C++ Programming
    Replies: 1
    Last Post: 03-07-2005, 03:04 PM
  4. help plz plz
    By nsssn73 in forum C++ Programming
    Replies: 2
    Last Post: 06-03-2002, 08:44 AM
  5. noob: compiling error... plz help!
    By chosii in forum C Programming
    Replies: 2
    Last Post: 05-10-2002, 05:53 AM