Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. can anyone give code in vc++

can anyone give code in vc++

Scheduled Pinned Locked Moved C / C++ / MFC
c++
17 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    N Ravi Raj
    wrote on last edited by
    #1

    when a day is given as input then output should be the weekday eg:06-04-2009 is given output should be 'monday' Thanks RaviRaj

    _ P 2 Replies Last reply
    0
    • N N Ravi Raj

      when a day is given as input then output should be the weekday eg:06-04-2009 is given output should be 'monday' Thanks RaviRaj

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      N.Ravi Raj wrote:

      when a day is given as input then output should be the weekday

      you should refer date time classes in C++ first and then if you don't find a solution, someone here may help. See GetDay function of COleDateTime

      You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

      N 1 Reply Last reply
      0
      • N N Ravi Raj

        when a day is given as input then output should be the weekday eg:06-04-2009 is given output should be 'monday' Thanks RaviRaj

        P Offline
        P Offline
        pallaka
        wrote on last edited by
        #3

        It should be in maths blog.Anyway Use the logic given below.....i hope it will help u The Basic Steps The basic steps for a date in the years 2000-2099 are as follows: Example date July 13th, 2004 1. Take the last 2 digits of the year and add a quarter onto itself. (04 + 1 = 5) 2. Get the corresponding code for the month. (January = 6, February = 2, March = 2, etc. See month codes for details). July = 5 3. Take the day. (=13) 4. Add the numbers together (5 + 5 + 13 = 23) 5. Take away 7 (or multiples of 7) until a number from 1-7 is left. (23 - 21 =2) 6. This number corresponds to the day of the week. (1 = Monday, 2 = Tuesday, etc.) In this case 2 = Tuesday The basic steps | Other points | Month codes | Leap years | Gregorian calendar | Shortcuts | Examples | Other methods | Books | Links | Whose idea? Other points to take into account Apart from the basic steps, other elements have to be taken into account: * When adding a quarter of the year onto itself, If the quarter of the year is not a whole number, simply ignore the decimals. Do not round up. Therefore 27/4 = 6.75 = 6, and 2/4 = 0.5 = 0. * Leap years: subtract 1 from the total if the month is January or February. * Negative numbers. During the calculation you get 0 or negative numbers, just add seven until you get a number from 1-7. * Different "centuries" *. o 1700s add 5 o 1800s add 3 o 1900s add 1 o 2100s subtract 2 o 2200s subtract 4 (* For this method we have to consider a '00' year as part of the new century) The basic steps | Other points | Month codes | Leap years | Gregorian calendar | Shortcuts | Examples | Other methods | Books | Links | Whose idea? The codes for the months At first the hardest part is learning the codes for the months. They are as follows: Jan Feb Mar Apr. May Jun Jul Ago Sept Oct Nov Dec 6 2 2 5 0 3 5 1 4 6 2 4 Try to use some memory system to remember the codes for the months. for example, February is the 2nd month, March 2 music, etc. Try to find associations that will remind you. If need be, you can add 7 or multiples of 7 to any of these values to help you remember them. For example, August could be 1 or 8, and as it is the 8th month, it may be easier to remember with 8 than with 1. This may be useful if you can match it with a well-known date. You could remember that the code for December is 25 (4+21), or for someone's birthday. The ne

        C C D 3 Replies Last reply
        0
        • P pallaka

          It should be in maths blog.Anyway Use the logic given below.....i hope it will help u The Basic Steps The basic steps for a date in the years 2000-2099 are as follows: Example date July 13th, 2004 1. Take the last 2 digits of the year and add a quarter onto itself. (04 + 1 = 5) 2. Get the corresponding code for the month. (January = 6, February = 2, March = 2, etc. See month codes for details). July = 5 3. Take the day. (=13) 4. Add the numbers together (5 + 5 + 13 = 23) 5. Take away 7 (or multiples of 7) until a number from 1-7 is left. (23 - 21 =2) 6. This number corresponds to the day of the week. (1 = Monday, 2 = Tuesday, etc.) In this case 2 = Tuesday The basic steps | Other points | Month codes | Leap years | Gregorian calendar | Shortcuts | Examples | Other methods | Books | Links | Whose idea? Other points to take into account Apart from the basic steps, other elements have to be taken into account: * When adding a quarter of the year onto itself, If the quarter of the year is not a whole number, simply ignore the decimals. Do not round up. Therefore 27/4 = 6.75 = 6, and 2/4 = 0.5 = 0. * Leap years: subtract 1 from the total if the month is January or February. * Negative numbers. During the calculation you get 0 or negative numbers, just add seven until you get a number from 1-7. * Different "centuries" *. o 1700s add 5 o 1800s add 3 o 1900s add 1 o 2100s subtract 2 o 2200s subtract 4 (* For this method we have to consider a '00' year as part of the new century) The basic steps | Other points | Month codes | Leap years | Gregorian calendar | Shortcuts | Examples | Other methods | Books | Links | Whose idea? The codes for the months At first the hardest part is learning the codes for the months. They are as follows: Jan Feb Mar Apr. May Jun Jul Ago Sept Oct Nov Dec 6 2 2 5 0 3 5 1 4 6 2 4 Try to use some memory system to remember the codes for the months. for example, February is the 2nd month, March 2 music, etc. Try to find associations that will remind you. If need be, you can add 7 or multiples of 7 to any of these values to help you remember them. For example, August could be 1 or 8, and as it is the 8th month, it may be easier to remember with 8 than with 1. This may be useful if you can match it with a well-known date. You could remember that the code for December is 25 (4+21), or for someone's birthday. The ne

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #4

          :omg: Wow, so you would code all of this instead of simply using an existing class (like COleDateTime for instance) that does all of that for you ?

          Cédric Moonen Software developer
          Charting control [v1.5] OpenGL game tutorial in C++

          1 Reply Last reply
          0
          • _ _AnsHUMAN_

            N.Ravi Raj wrote:

            when a day is given as input then output should be the weekday

            you should refer date time classes in C++ first and then if you don't find a solution, someone here may help. See GetDay function of COleDateTime

            You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

            N Offline
            N Offline
            N Ravi Raj
            wrote on last edited by
            #5

            urgent please code in vc++ thanks

            R _ 2 Replies Last reply
            0
            • N N Ravi Raj

              urgent please code in vc++ thanks

              R Offline
              R Offline
              Rajesh R Subramanian
              wrote on last edited by
              #6

              If your query is urgent, you can go to rentacoder[^]

              It is a crappy thing, but it's life -^ Carlo Pallini

              H 1 Reply Last reply
              0
              • N N Ravi Raj

                urgent please code in vc++ thanks

                _ Offline
                _ Offline
                _AnsHUMAN_
                wrote on last edited by
                #7

                I gave more than what you asked for in your query. Now it's up to you to use it.

                You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

                1 Reply Last reply
                0
                • R Rajesh R Subramanian

                  If your query is urgent, you can go to rentacoder[^]

                  It is a crappy thing, but it's life -^ Carlo Pallini

                  H Offline
                  H Offline
                  Hamid Taebi
                  wrote on last edited by
                  #8

                  He can waits for Palini.

                  Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

                  C 1 Reply Last reply
                  0
                  • P pallaka

                    It should be in maths blog.Anyway Use the logic given below.....i hope it will help u The Basic Steps The basic steps for a date in the years 2000-2099 are as follows: Example date July 13th, 2004 1. Take the last 2 digits of the year and add a quarter onto itself. (04 + 1 = 5) 2. Get the corresponding code for the month. (January = 6, February = 2, March = 2, etc. See month codes for details). July = 5 3. Take the day. (=13) 4. Add the numbers together (5 + 5 + 13 = 23) 5. Take away 7 (or multiples of 7) until a number from 1-7 is left. (23 - 21 =2) 6. This number corresponds to the day of the week. (1 = Monday, 2 = Tuesday, etc.) In this case 2 = Tuesday The basic steps | Other points | Month codes | Leap years | Gregorian calendar | Shortcuts | Examples | Other methods | Books | Links | Whose idea? Other points to take into account Apart from the basic steps, other elements have to be taken into account: * When adding a quarter of the year onto itself, If the quarter of the year is not a whole number, simply ignore the decimals. Do not round up. Therefore 27/4 = 6.75 = 6, and 2/4 = 0.5 = 0. * Leap years: subtract 1 from the total if the month is January or February. * Negative numbers. During the calculation you get 0 or negative numbers, just add seven until you get a number from 1-7. * Different "centuries" *. o 1700s add 5 o 1800s add 3 o 1900s add 1 o 2100s subtract 2 o 2200s subtract 4 (* For this method we have to consider a '00' year as part of the new century) The basic steps | Other points | Month codes | Leap years | Gregorian calendar | Shortcuts | Examples | Other methods | Books | Links | Whose idea? The codes for the months At first the hardest part is learning the codes for the months. They are as follows: Jan Feb Mar Apr. May Jun Jul Ago Sept Oct Nov Dec 6 2 2 5 0 3 5 1 4 6 2 4 Try to use some memory system to remember the codes for the months. for example, February is the 2nd month, March 2 music, etc. Try to find associations that will remind you. If need be, you can add 7 or multiples of 7 to any of these values to help you remember them. For example, August could be 1 or 8, and as it is the 8th month, it may be easier to remember with 8 than with 1. This may be useful if you can match it with a well-known date. You could remember that the code for December is 25 (4+21), or for someone's birthday. The ne

                    C Offline
                    C Offline
                    Chris Losinger
                    wrote on last edited by
                    #9

                    it's always good to give credit where credit's due[^]...

                    image processing toolkits | batch image processing

                    T 1 Reply Last reply
                    0
                    • P pallaka

                      It should be in maths blog.Anyway Use the logic given below.....i hope it will help u The Basic Steps The basic steps for a date in the years 2000-2099 are as follows: Example date July 13th, 2004 1. Take the last 2 digits of the year and add a quarter onto itself. (04 + 1 = 5) 2. Get the corresponding code for the month. (January = 6, February = 2, March = 2, etc. See month codes for details). July = 5 3. Take the day. (=13) 4. Add the numbers together (5 + 5 + 13 = 23) 5. Take away 7 (or multiples of 7) until a number from 1-7 is left. (23 - 21 =2) 6. This number corresponds to the day of the week. (1 = Monday, 2 = Tuesday, etc.) In this case 2 = Tuesday The basic steps | Other points | Month codes | Leap years | Gregorian calendar | Shortcuts | Examples | Other methods | Books | Links | Whose idea? Other points to take into account Apart from the basic steps, other elements have to be taken into account: * When adding a quarter of the year onto itself, If the quarter of the year is not a whole number, simply ignore the decimals. Do not round up. Therefore 27/4 = 6.75 = 6, and 2/4 = 0.5 = 0. * Leap years: subtract 1 from the total if the month is January or February. * Negative numbers. During the calculation you get 0 or negative numbers, just add seven until you get a number from 1-7. * Different "centuries" *. o 1700s add 5 o 1800s add 3 o 1900s add 1 o 2100s subtract 2 o 2200s subtract 4 (* For this method we have to consider a '00' year as part of the new century) The basic steps | Other points | Month codes | Leap years | Gregorian calendar | Shortcuts | Examples | Other methods | Books | Links | Whose idea? The codes for the months At first the hardest part is learning the codes for the months. They are as follows: Jan Feb Mar Apr. May Jun Jul Ago Sept Oct Nov Dec 6 2 2 5 0 3 5 1 4 6 2 4 Try to use some memory system to remember the codes for the months. for example, February is the 2nd month, March 2 music, etc. Try to find associations that will remind you. If need be, you can add 7 or multiples of 7 to any of these values to help you remember them. For example, August could be 1 or 8, and as it is the 8th month, it may be easier to remember with 8 than with 1. This may be useful if you can match it with a well-known date. You could remember that the code for December is 25 (4+21), or for someone's birthday. The ne

                      D Offline
                      D Offline
                      David Crow
                      wrote on last edited by
                      #10

                      Simply providing a link would have sufficed: http://www.terra.es/personal2/grimmer/[^]

                      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                      1 Reply Last reply
                      0
                      • C Chris Losinger

                        it's always good to give credit where credit's due[^]...

                        image processing toolkits | batch image processing

                        T Offline
                        T Offline
                        toxcct
                        wrote on last edited by
                        #11

                        wow, neat !

                        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                        1 Reply Last reply
                        0
                        • H Hamid Taebi

                          He can waits for Palini.

                          Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

                          C Offline
                          C Offline
                          CPallini
                          wrote on last edited by
                          #12

                          Hamid. wrote:

                          Palini

                          Wow, It's me? Uhm.....No, I'm Pallini! :-D

                          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                          [My articles]

                          H 1 Reply Last reply
                          0
                          • C CPallini

                            Hamid. wrote:

                            Palini

                            Wow, It's me? Uhm.....No, I'm Pallini! :-D

                            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                            [My articles]

                            H Offline
                            H Offline
                            Hamid Taebi
                            wrote on last edited by
                            #13

                            Yeah thats right. :-D btw may I ask a quetion?

                            Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

                            C 1 Reply Last reply
                            0
                            • H Hamid Taebi

                              Yeah thats right. :-D btw may I ask a quetion?

                              Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

                              C Offline
                              C Offline
                              CPallini
                              wrote on last edited by
                              #14

                              Hamid. wrote:

                              btw may I ask a quetion?

                              You know you can. :-D

                              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                              [My articles]

                              H 1 Reply Last reply
                              0
                              • C CPallini

                                Hamid. wrote:

                                btw may I ask a quetion?

                                You know you can. :-D

                                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                [My articles]

                                H Offline
                                H Offline
                                Hamid Taebi
                                wrote on last edited by
                                #15

                                I was watched mvp.support.microsoft.com last night and I saw name of some members of codeproject(btw I saw your name CONGRATULATION Calro:-D ) I want to know is this depend to mvp that we could to get of codeproject or its different (I only got a mail chris 1 jan)? Thanks :)

                                Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

                                C 1 Reply Last reply
                                0
                                • H Hamid Taebi

                                  I was watched mvp.support.microsoft.com last night and I saw name of some members of codeproject(btw I saw your name CONGRATULATION Calro:-D ) I want to know is this depend to mvp that we could to get of codeproject or its different (I only got a mail chris 1 jan)? Thanks :)

                                  Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

                                  C Offline
                                  C Offline
                                  CPallini
                                  wrote on last edited by
                                  #16

                                  Hamid. wrote:

                                  I want to know is this depend to mvp that we could to get of codeproject or its different (I only got a mail chris 1 jan)?

                                  So far I've posted only on Code Project so I got it thanks to Code Project. I think you should be noticed by your local Ms MVP leader in order to get the award. Good luck & best wishes! :)

                                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                  [My articles]

                                  H 1 Reply Last reply
                                  0
                                  • C CPallini

                                    Hamid. wrote:

                                    I want to know is this depend to mvp that we could to get of codeproject or its different (I only got a mail chris 1 jan)?

                                    So far I've posted only on Code Project so I got it thanks to Code Project. I think you should be noticed by your local Ms MVP leader in order to get the award. Good luck & best wishes! :)

                                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                    [My articles]

                                    H Offline
                                    H Offline
                                    Hamid Taebi
                                    wrote on last edited by
                                    #17

                                    Well I think its not possible so I need to do it myself.

                                    Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

                                    1 Reply Last reply
                                    0
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    • Login

                                    • Don't have an account? Register

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • World
                                    • Users
                                    • Groups