Given the amount of days that have passed in the current year, (assume no leap years for now), give the date.
For example,
- If you input 1, your script should return January 1
- If you input 17, your script should return February 17
- If you input 32, your script should return February 1
- If you input 60, your script should return March 1
- If you input 364, your script should return December 30
Right Now:
You need to analyze the algorithm that humans use to do this. Have a year calendar open. Look at the dates. How do YOU do this? What feature of code can you use to automate this? You will work on paper for a bit here. Stay organized and be able to explain your method to your whole group. You won't be able to code it until you have designed the program.
You need to analyze the algorithm that humans use to do this. Have a year calendar open. Look at the dates. How do YOU do this? What feature of code can you use to automate this? You will work on paper for a bit here. Stay organized and be able to explain your method to your whole group. You won't be able to code it until you have designed the program.
10/17/2019 Update:
Finish up yesterday's calendar project. When you are done:
1) Add a question that asks: "What is the Year?"
1) Add a question that asks: "What is the Year?"
- If the year given is a leap year, your calendar project should adjust.
- Make sure you use your custom blocks from 3.3
- For example, say the user gives that 64 days have passed this year.
- If it not a leap year, the date is March 5. If it is a leap year, the date is March 4.
The Gregorian Calendar was enacted in 1582 to account for calendrical drift. Essentially, this was a way to account for the fact that the earth's orbit is approximately 365.242 days. Given that January 1, 1583 is defined as a Saturday:
- Use logic and math to find out what day January 1st fell on for the years 1583 to 1593. You can use google to check your answer, but you should be able to explain WHY the day changes each year.
- Now, create a custom block that will give you the day of the week January 1st falls on for any year after 1582.
- Use the output of the block above to determine what day of the week a day is in any given date. For example, if the date is 10.16.2019, the day is Wednesday.
- Incorporate this math into your Calendar Update program to give the day of the week as well as the date.
2) Study for Next Week's upcoming test with the study guides posted earlier.
No comments:
Post a Comment