Question

1 Overview This assignment covers control flow, including if-statements and functions, as well as the use of various arithmetic operators. It also provides an introduction to error handling in cases where

a program component receives incorrect data, and to unit testing to validate the correctness of a set of functions. You will implement a set of functions which perform various operations on calendar dates. A template file date_functions.c has been provided containing several empty functions (along with a main () function containing some simple tests). Your task is to implement each function according to the specification given in the comments above the function. You may also add extra functions as needed, but you are not permitted to change the function signature of the existing functions in any way. For example, you may not rename the functions, change the types or names of the parameters, add new parameters or modify the return type. Submissions which violate this requirement will receive a mark of zero. Although each function will be marked separately, you must ensure that the entire file compiles successfully (since a syntax error in one function will make it impossible for the teaching team to compile your submission and mark any of your functions). You are responsible for thoroughly testing each function. Some basic tests have been provided in the main() function of the template, but you will need to do more testing to fully validate your implementations. When the code is tested, we will substitute our own main() function to test your code. Note that the contents of main() in your submission will not be marked (although, as mentioned above, you must ensure that the entire file compiles successfully, including whatever code you put in main()); all of the marks for this assignment are based on the other functions. The sections below describe each function in more detail. In the event that this document is not consistent with the specifications written in the posted template code, the template code will be