Question
Write a program that accepts a date in the format MM-DD-YYYY from the user and determines and displays the day number 1-366 for the day
Write a program that accepts a date in the format MM-DD-YYYY from the user and determines and displays the day number 1-366 for the day of the year corresponding to the entered date. For an entered date of 05-31-1999 the program should display the message May 31, 1999 is day number 151.
Your program should account for leap years. In leap years February has 29 days. In non-leap years February has 28 days. A year is a leap year if it divisible by 4, but not by 100 or if it is divisible by 400. Your program must include a function named isLeapYear that takes an integer corresponding to a year as its only argument and returns the Boolean value true if the year is a leap year and false if the year is not a leap year. i.e. The function must implement the following prototype: bool isLeapYear (int year);
In addition your program must include at least two other meaningful called functions (in addition to main and isLeapYear. It can contain more than two.
Remember every function definition must be preceded by a comment that tells what the function does, the arguments it takes, and the values it returns (if any).
Your program must use at least one switch statement in a meaningful way.
Your program must include input validation. i.e. It must do range checking on input months, days, and years.
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