Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program must be written in C#. Any steps or directions would be appreciated. 1 2 3 4 5Write and test a program that Read in
Program must be written in C#. Any steps or directions would be appreciated.
1 2 3 4 5Write and test a program that Read in a date and then determine if the date is valid date 789 101 19or not. If the date is valid then print the date with the name of the month. This program 14 , 18 19 20, e use methods 21 22 23 24 25 26 27 28 29 30 31 Do not change the names of any of the methods, or their number or data types of parameters. Write the header EXACTLY the same way as given below private static bool validDate (int day, int month, int year) Given the numbers for the date, i.e., day, month and year, this method determine whether these values represent a valid date. Return true is the date is valid, false otherwise. Limit the years from 1 to 3000. You must also consider leap years. This can be done by having this function call the isLeapYear function (described next) Examples of invalid dates are: a. 14/4/1999 b. 1/40/3999 c. 2/29/1900 private static bool isLeapYear (int year) This method determines whether the parameter, year, is a leap year. Return true is the year is leap,false otherwise. A leap year is defined as a year that is divisible by 4 except that those years that are divisible by 100 are not leap years unless they are also divisible by 400. This function is used by function such as validDate . Examples: 1900 is divisible by 4 but is not a leap year; 2000 is a leap year. private static void printDate (int day, int month, int year) Description: Print the date information to the screen. The name of the month must be spelled out Test your program with the following dates. 4/15/2014 or 12/25/2001 or 1/1/2015 or 13/4/1200 AND 14/5/199 or 2/29/2002 Hint: Description: Here is the algorithm for the main function Begin print a description of the program for the user repeat Prompt the user for the three values of a date. if the date is valid (call the validDate method to determine this) call the printDate method to display the date else print an error messageStep 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