The document is a student assignment containing instructions for 3 programming questions. It asks the student to:
1. Write a program to check if a year is a leap year, including a function to check this.
2. Write a program to print an ordinal number (1st, 2nd, etc.) including a function to add the suffix.
3. Write a program to calculate and print the day of the year given a month and date, reusing the suffix function from question 2.
The document is a student assignment containing instructions for 3 programming questions. It asks the student to:
1. Write a program to check if a year is a leap year, including a function to check this.
2. Write a program to print an ordinal number (1st, 2nd, etc.) including a function to add the suffix.
3. Write a program to calculate and print the day of the year given a month and date, reusing the suffix function from question 2.
The document is a student assignment containing instructions for 3 programming questions. It asks the student to:
1. Write a program to check if a year is a leap year, including a function to check this.
2. Write a program to print an ordinal number (1st, 2nd, etc.) including a function to add the suffix.
3. Write a program to calculate and print the day of the year given a month and date, reusing the suffix function from question 2.
PNF INFORMÁTICA IDC 433 INGLÉS Word Formation: Suffixes Date: 8/11/2022 Student ´s name: Moreno Yam Daniel I. D: 17.534.402
Read the following paragraphs and circle ten (10) suffixes.
Question 1: Leap Year A leap year is a calendar year containing an extra day to synchronize the calendar to seasons and astronomical events. In the Gregorian calendar, years that are multiples of four (with the exception of years divisible by 100 but not by 400) are leap years. Write a program that reads in an integer representing a year from the standard input and prints out " is a leap year" if the input is a leap year. Otherwise, print " is not a leap year" to the standard output. Your program should include a bool function is_leap_year that takes in the input year and returns true if the input is a leap year and returns false otherwise. Question 2: Ordinal Suffix In English, an ordinal number is written with numerals, followed by its letter suffixes. For instence: 1 st , 2 nd , 3 rd , 4 th , 11 th , 31 st , etc. The rule is that, a number that ends with digit 1 should have a suffix "st" (except if it ends with 11), a number that ends with 2 should have a suffix "nd" (except if it ends with 12), and a number that ends with 3 should have a suffix "rd" (except if it ends with 13). All other numbers should end with "th". Write a program suffix that reads in an integer number from the standard input and prints out the number with its ordinal suffix. Your program should include a void function print_with_suffix(long n) that takes in the input and prints out the number followed by its suffix. Question 3: Days Since 1 January Write a program called days that reads in two integers from the standard input, the first is the month (ranged 1 to 12, inclusive) and the second is the day (ranged 1 to 31, inclusive). The program should print to the standard output which day of the year it is. Assume that the year is not a leap year. You can reuse the method print_suffix from the previous question