Question
Design an algorithm for determining the day of the week of any date since January 1,1700 . For example, August 17, 2001 was a Friday.
Step 1
A year is a leap year if it is divisible by 4, except for years that are divisible by 100, unless they are also divisible by 400. For example, 2000 is a leap year but 1900 is not. Show more…
Show all steps
Your feedback will help us improve your experience
Mayank Tripathi and 68 other educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Design an algorithm for determining whether a particular year is a leap year. For example, the year 2000 was a leap year.
(Find future dates) Write a program that prompts the user to enter an integer for today's day of the week (Sunday is 0, Monday is 1, ...., and Saturday is 6). Also prompt the user to enter the number of days after today for a future day and display the future day of the week. Here is a sample run: Enter today's day: 1 Enter the number of days elapsed since today: 3 Today is Monday and the future day is Thursday Enter today"s day: 0 Enter the number of days elapsed since today: 31 Today is Sunday and the future day is Wednesday
(Find future dates) Write a program that prompts the user to cnter an integer for today's day of the week (Sunday is 0, Monday is 1, ...., and Saturday is 6). Also prompt the user to enter the number of days after today for a future day and display the future day of the week. Here is a sample run:
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD