Results 1 to 6 of 6

Thread: This will test you go on try

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Mirfield,West Yorkshire,Englan
    Posts
    11

    Unhappy Change of plan, begginer seiks help

    Can you write a pgm that will use this algorithm to find the day of the week from any date between the 1st January 1800 and the 31st December 1999
    1 Take the last two digits of the year
    2 add a quarter of this neglecting any remainder
    3 add the day of the month
    4 for January add 1 (if a leap year add 0)
    february add 4 (if a leap year add 3)
    march add 4
    april add 0
    may add 2
    june add 5
    july add 0
    august add 3
    september add 6
    october add 1
    november add 4
    december add 6

    5 for 1800 - m1899 add 2
    1900 onwards add 0

    6 divide the result by 7 and the remainder gives the day of the week
    1= sunday 2 = monday 3 = tuesday 4 = wednesday 5 =
    thursday 6 = friday 7 = saturday

    write a pgm that will accept the date in dd:mm:yyyy then using the above method calculate which day of the week it falls on and display this date



  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Is this coursework or something? Seems a bit well-defined to me.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    He's trying to con us, lynch him!!!
    If it wasn't for this sentence I wouldn't have a signature at all.

  4. #4
    Guest
    One, i have found the answer to this, and its actually quite easy.

    Two, you wont be able to get any one to do your homework, but they will help.

  5. #5
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Originally posted by Sam Finch
    He's trying to con us, lynch him!!!
    Wow Sam is mean
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Has he ever not been?

    Robert - to exactly answer your question, yes.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width