Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Can anybody please write a program for me with the following directions:
Write a program to determine the day of the week a person was born given his or her birth date. Following are the steps you should use to find the day of the week corresponding to any date in this century.
A) Divide the last 2 digits of the birth year by 4. Put the quotient (ignoring the remainder) in Total. For example, if the person was born in 1983, divide 83 by 4 and store 20 in Total.
B) Add the last two digits of the birth year to the Total.
C) Add the day portion to the birth date to Total.
D)Using the following table, find the "Month Number" and add it to the total.
January = 1, February = 4, March = 4, April = 0, May = 2, June = 5, July = 0, August = 3, September = 6, October = 1, November = 4, and December = 6.
E) If the year is a leap year and, if the month you are working with is either January or February, then subtract 1 from the Total.
F) Find the remainder when Total is divided by 7. Look up the remainder in the following table to determine the day of the week the person was born. Note that you should not use this procedure if the person's year of birth is earlier than 1900.
1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, and 0 = Saturday.
A typical line of data is
5 - 15 78
where the first entry (5-15) represents the month and day (May 15) and the second entry (78) represents the birth year. An appropriate error message should be printed if a person's year of birth is before 1900.
This would be a HUGE help for me... if you have a web site, I will link to it to my site, www.Internapse.com
Please post the program here or you can e-mail it to me at MarvelMania2001@yahoo.com
THANK YOU SO MUCH
0 · ·