help on turbo C. timeZ converter

Discussion in 'C' started by haru31773, Mar 9, 2010.

  1. haru31773

    haru31773 New Member

    Joined:
    Mar 9, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    I GOT THIS very rush project , i nid to make a TIMEZONE converter program,

    it goes like this, u enter ur nations time. ex( philippines 9:00)< this must be constant.

    then the program converts the time and should display the different timezones of 10 different countries

    output:
    ex.( us:8;00 can: 8;30 ph 8;45 etc..)



    i have tried looping, but i just cant get right, i really nid ur suggestions.:freak:
     
  2. haru31773

    haru31773 New Member

    Joined:
    Mar 9, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    hen the program converts the time and should display the"EQUIVALENT" different timezones of 10 different countries

    ^^
     
  3. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28
    where is your code so far?
     
  4. haru31773

    haru31773 New Member

    Joined:
    Mar 9, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    still working on it atm, but clueless,
     
  5. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Take it step by step and make sure each bit works before moving onto the next bit. Don't attempt to write the whole program in one go. Get the input from the user and convert it however you want, then display what you think you've got.

    If that's correct then move onto the next bit: if it's a loop, forget the loop for now and just do it for one thing, so having got the data for PH then do the conversion for US and display the result, and make sure that is correct before moving on. Bear in mind that you will be implementing a loop at some point, so maybe make the code dependent on what will be a loop variable:
    Code:
    int i=0;
    i=5;
    // some code dependent on i, and eventually you will have:
    
    for (int i=0; i<10; i++)
    {
        // some code dependent on i
    }
    
    Then implement the loop. This bit should be fairly trivial once you've got the preceding steps worked out, and if I've read the problem description correctly then that should be it.

    When you get stuck post the complete code. It shouldn't be too long; I expect the whole of this program can be done in less than 50 lines of code. Make sure your code is indented correctly and uses sensible variable names, and use code blocks* to ensure the formatting is preserved.

    *which you know about, having read the posting guidelines, right?
     
  6. haru31773

    haru31773 New Member

    Joined:
    Mar 9, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    k bro ill try it , thx
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice