Thread: i have no idea..

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    32

    i have no idea..

    Can anyone do this question? i have no idea how to do it cos im a newbie, it should only take a veteran a few minutes to do, im desperate here, thank you, brad.

    question; using a structure variable(including day, month and year), the programme reads a date from the keyboard and then find out how many days away from 25 december (note: leap years must be considered).

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    Ehm, you need a structure like this:

    Code:
    struct date
    {
        int day;
        int month;
        int year;
    }
    You can use scanf or something like that to read in a date from the keyboard.

    How many days away from 25 december which year?

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    32
    it has to be calculable from any year before 2003

  4. #4
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    I see. And what is your question? I do not understand what your problem is.

    [edit]
    Could you perhaps post the code which causes the problem(s)?
    [/edit]

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    32
    ok the problem i have is that im really bad with c, ive only just started and ive to do a few questions, this is the last one and i havent a clue where to start. its crucial that i do it by 2nite, im sorry that im asking ppl to do it for me but i have no other options...

  6. #6
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    The first thing is to make clear what they want to. I think you want to go coding directly, but first make clear which algorithms you need.

    Input: a date
    Output: days since 25 december of a certain year

    It's unclear to me which year is the year you have to calculate from.

    How would you calculate the number of days since that certain year?

  7. #7
    Registered User
    Join Date
    Apr 2002
    Posts
    32
    i would input a date say 14.01.2001 and the output would be 351 days (days until 25.12.2002). to calculate a leap year, 1 thought was to make it realise that the year 2000 was a leap year and therefore make it also realise that every 4 years before that is as well. maybe by adding a year onto every 1460 days (every 4 years) starting from 2000 and back from then.

  8. #8
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    question; using a structure variable(including day, month and year), the programme reads a date from the keyboard and then find out how many days away from 25 december (note: leap years must be considered).
    Perhaps if you read your previous posts then you would realize I've already answered this question in full. What, do you want it written for you?

    -Prelude
    My best code is written with the delete key.

  9. #9
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by Prelude

    Perhaps if you read your previous posts then you would realize I've already answered this question in full. What, do you want it written for you?

    -Prelude
    You had to ask? Of course they want it written for them! It's HOMEWORK!

    Quzah.
    Hope is the first step on the road to disappointment.

  10. #10
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >You had to ask?
    Not really, the answer was obvious anyway.

    >Of course they want it written for them! It's HOMEWORK!
    True, but they could at least show some respect and not post the same question after it's already been answered. It's incredibly rude.

    -Prelude
    My best code is written with the delete key.

  11. #11
    Registered User
    Join Date
    Apr 2002
    Posts
    32
    sorry guys for wastin your time, and i didnt mean to be rude, its just im no expert with c nor will i ever be, but for this particular module, it is very important. Brad.

  12. #12
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >sorry guys for wastin your time
    You're not wasting our time, but it usually helps to read the replies to your posts before starting a new thread.

    >for this particular module, it is very important
    Take a look here for all the answers you asked for earlier:
    http://www.cprogramming.com/cboard/s...threadid=16056

    -Prelude
    My best code is written with the delete key.

  13. #13
    Registered User
    Join Date
    Apr 2002
    Posts
    32
    cheers.

    Brad.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. project idea ???
    By gemini_shooter in forum C Programming
    Replies: 2
    Last Post: 06-09-2005, 09:56 AM
  2. Have an idea?
    By B0bDole in forum Projects and Job Recruitment
    Replies: 46
    Last Post: 01-13-2005, 03:25 PM
  3. A little problem about an idea, help please
    By louis_mine in forum C++ Programming
    Replies: 3
    Last Post: 09-10-2004, 09:52 PM
  4. totally screwed up idea
    By iain in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 08-17-2001, 12:09 PM