Question: C + + write a program that prints the day number of the year, given the date in the form month - day - year.
C write a program that prints the day number of the year, given the date in the form monthdayyear. For example, if the input is the day number is ; if the input is the day number is The program should check for a leap year. A year is a leap year if it is divisible by but not divisible by For example, and are divisible by but not by A year that is divisible by is a leap year if it is also divisible by For example, and are divisible by However, is not a leap year because is not divisible by
Your program must define and use the following functions:
isLeapYear This function must accept the year as an argument. It must return true if the year is a leap year and false if it is not a leap year.
determineDaysInMonth This function must accept the month and year as arguments. It must return the number of days in the month. Beware of leap years! Hint: A switch would be very useful here.
computeDayofYear This function must accept the month, day, and year as arguments. It must return the day number of the year.
print This function will accept the day number of the year and the year as arguments. It must print the day number of the year with explanatory text. It will not return a value.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
