Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Long Count Calendar The Mayans designed the Long Count calendar to track a long period of time which they call the Great Cycle or
The Long Count Calendar The Mayans designed the Long Count calendar to track a long period of time which they call the Great Cycle or Universal Cycle. Each cycle is approximately 5,125 years. Dates are written as five numbers separated by periods, such as 13.0.0.0.1 (The ancient Maya did not use Arabic numerals of course, but their own hieroglyphs). The right-most position is called the k'in, which counts single days: 13.0.0.0.1, for example. The k'in counts up to 19 and then flips back to zero, with counting picked back up by the next position, the uinal. So 13.0.0.0.19 would become 13.0.0.1.0, much like a car odometer. Each uinal is thus a block of 20 days. The k'in position then picks back up, counting up to that 20, which then gets added to the uinal. So the day after 13.0.0.1.0 would be 13.0.0.1.1 and then 13.0.0.1.2, all the way up to 13.0.0.1.19 and finally 13.0.0.2.0. The uinals count upward as well. While the Maya generally use a base-20 counting system, Witschey said, they modify this slightly for the uinal, which only counts up to 17 before rolling over to the third position, the tun. Each tun is thus 18 blocks of 20 days, or 360 days approximately a year by the solar calendar. Tuns, in turn, count up to 20 before rolling over into k'atuns. As 20 blocks of 360 days, each k'atun translates into 7,200 days, or just less than 20 years. The k'atun place then counts up before rolling over into the final digit, the b'ak'tun. If that word sounds familiar, it's because Dec. 21, 2012, on our calendar marks the end of the 13th b'aktun of the Mayan Long Count Calendar. In other words, it's the day the count will read 13.0.0.0.0. On Dec. 22, it will read 13.0.0.0.1. Each b'ak'tun is 144,000 days long, or a little less than 400 years. To the ancient Maya, 13 b'ak'tuns represented a full cycle of creation; one carving refers to a god associated with calendar changes returning that day. There are no apocalyptic prophecies, however. In fact, the Maya had several rarely used units that were even larger than b'ak'tuns, giving them the capacity to count millions of years into the future. 1. bool is_leap year(int year) to determine if a given year is leap. Note that not all years which are multiples of 4 are leap. Centuries are not leap unless they are multiples of 400. 2. int days_in_month(int month, int year) that takes the month (an integer from 1 to 12) and year, and returns number of days in the given month (an integer from 1 to 31). Note that you should use the is_leap year function to determine if February has 28 or 29 days. 3. int days_from_epoch (int day, int month, int year) that computes and returns the number of days from the epoch, 1 January 19702, to the input date. For example. days_from_epoch(10, 1, 1970) returns 9 because it is nine days away from the epoch. Task 1: Gregorian to Mayan (2 marks) Implement the function void greg_to_mayan(int day, int month, int year) that takes as input a date on our Gregorian Calendar, and prints the equivalent date in the Maya Long Calendar The Gregorian Calendar does not go far back enough into the past, so we will take the ref- erence point to be 21 December 2012, which is equivalent to 13.0.0.0.0 on the Maya Long Calendar The functions is_leap year , days_in_month and days_from_epoch from Problem Set 3 has been defined and available for you on Coursemology. So you do not need to copy them into your solution box. Example: greg_to_mayan (21, 12, 2012); 13.0.0.0.0 Task 2: Mayan to Gregorian (3 marks) Implement the function void mayan_to_greg(int baktun, int katun, int tun, int uinal, int kin) that takes as input a date on the Maya Long Calendar and prints the equivalent date of our Gregorian Calendar in d/m/yyyy format, i.e., numerals without leading zeros. Example: mayan_to_greg (13, 0, 0, 0, 0); 21/12/2012 The Long Count Calendar The Mayans designed the Long Count calendar to track a long period of time which they call the Great Cycle or Universal Cycle. Each cycle is approximately 5,125 years. Dates are written as five numbers separated by periods, such as 13.0.0.0.1 (The ancient Maya did not use Arabic numerals of course, but their own hieroglyphs). The right-most position is called the k'in, which counts single days: 13.0.0.0.1, for example. The k'in counts up to 19 and then flips back to zero, with counting picked back up by the next position, the uinal. So 13.0.0.0.19 would become 13.0.0.1.0, much like a car odometer. Each uinal is thus a block of 20 days. The k'in position then picks back up, counting up to that 20, which then gets added to the uinal. So the day after 13.0.0.1.0 would be 13.0.0.1.1 and then 13.0.0.1.2, all the way up to 13.0.0.1.19 and finally 13.0.0.2.0. The uinals count upward as well. While the Maya generally use a base-20 counting system, Witschey said, they modify this slightly for the uinal, which only counts up to 17 before rolling over to the third position, the tun. Each tun is thus 18 blocks of 20 days, or 360 days approximately a year by the solar calendar. Tuns, in turn, count up to 20 before rolling over into k'atuns. As 20 blocks of 360 days, each k'atun translates into 7,200 days, or just less than 20 years. The k'atun place then counts up before rolling over into the final digit, the b'ak'tun. If that word sounds familiar, it's because Dec. 21, 2012, on our calendar marks the end of the 13th b'aktun of the Mayan Long Count Calendar. In other words, it's the day the count will read 13.0.0.0.0. On Dec. 22, it will read 13.0.0.0.1. Each b'ak'tun is 144,000 days long, or a little less than 400 years. To the ancient Maya, 13 b'ak'tuns represented a full cycle of creation; one carving refers to a god associated with calendar changes returning that day. There are no apocalyptic prophecies, however. In fact, the Maya had several rarely used units that were even larger than b'ak'tuns, giving them the capacity to count millions of years into the future. 1. bool is_leap year(int year) to determine if a given year is leap. Note that not all years which are multiples of 4 are leap. Centuries are not leap unless they are multiples of 400. 2. int days_in_month(int month, int year) that takes the month (an integer from 1 to 12) and year, and returns number of days in the given month (an integer from 1 to 31). Note that you should use the is_leap year function to determine if February has 28 or 29 days. 3. int days_from_epoch (int day, int month, int year) that computes and returns the number of days from the epoch, 1 January 19702, to the input date. For example. days_from_epoch(10, 1, 1970) returns 9 because it is nine days away from the epoch. Task 1: Gregorian to Mayan (2 marks) Implement the function void greg_to_mayan(int day, int month, int year) that takes as input a date on our Gregorian Calendar, and prints the equivalent date in the Maya Long Calendar The Gregorian Calendar does not go far back enough into the past, so we will take the ref- erence point to be 21 December 2012, which is equivalent to 13.0.0.0.0 on the Maya Long Calendar The functions is_leap year , days_in_month and days_from_epoch from Problem Set 3 has been defined and available for you on Coursemology. So you do not need to copy them into your solution box. Example: greg_to_mayan (21, 12, 2012); 13.0.0.0.0 Task 2: Mayan to Gregorian (3 marks) Implement the function void mayan_to_greg(int baktun, int katun, int tun, int uinal, int kin) that takes as input a date on the Maya Long Calendar and prints the equivalent date of our Gregorian Calendar in d/m/yyyy format, i.e., numerals without leading zeros. Example: mayan_to_greg (13, 0, 0, 0, 0); 21/12/2012
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started