Jump to content

a guide to follow for an exercise please

- - - - -

  • Please log in to reply
3 replies to this topic

#1
thirstymind

thirstymind

    Newbie

  • Members
  • Pip
  • 6 posts
just a guide how to start please(and a little bit explanation) :-P , (i dont want you to solve my exercise,i know is not right and is unfair,that s why i only ask for a little help),
thank you very match for your time.

''Build an algorithm that calculates the day of the week on which is your birthday every and any year, having as data, the day of the week and date of birth.''

''Take the "original number"
put the candidate "first". equal to the initial "number"
reiterated''

#2
Gerg? Magyar

Gerg? Magyar

    Newbie

  • Members
  • PipPip
  • 22 posts
1. : string entering
20/12/2011-->day/month/year
Date form: 00/00/0000 --> 10 char

      type TData = record

               d, m, y : word;

              end;

      
2.: Storage

      if not length(string)= 10 then repeat string entering

      TData.y := StrToInt(Copy( string, lenght(string)-4, lenght(string));

      Delete( string, lenght(string)-4, lenght(string));                                    //delete year + /

      TData.m := StrToInt(Copy( string, lenght(string)-2, lenght(string));

      Delete( string, lenght(string)-3, lenght(string));                                   //delete month + /

      TData.d := StrToInt(Copy( string, 1, lenght(string));

     


#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Do you know the algorithm to determine the day of the week of a date?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
thirstymind

thirstymind

    Newbie

  • Members
  • Pip
  • 6 posts
i have to say only this,YOU ARE INGREDIBLE GUYS,THANK YOU.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users