Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Introduction toming Finishing the Y 2 K Projec At this point, your project should contain the following functions: bool is leap year ( long year
Introduction toming Finishing the YK Projec
At this point, your project should contain the following functions:
bool is leap yearlong year
int query for longstring prompt
int returndaysinyearlong year
int return days inmonth long year, long month
int main that computes the number of days since the beginning of the epoch January
These functions should already be tested as working.
In this assignment, write functions with the prototype:
string returnmonthname Iong month ;
That returns the name of the month represented by month. The function was presented in class and requires the use of a string array containing the names of each month.
Date returndate long dayssinceepoch ;
That returns the date represented by dayssinceepoch. The function returns a variable of the abstract data type Date that is defined as:
struct Date
long year ;
long month ;
long day :
;
To accomplish this task, first query the user to enter a year, month, day, compute the number of days since the beginning of our epoch, and display an appropriate message.
This is what the user might see when using the program:
Enter a year:
Enter a nonth:
Enter a day:
There are days between and
represents the date June
The bold values above are examples of what the user might type in response to the three queries or are a result of computation performed byit
Include one or more of the following functions:
int queryforvaliddaylong year, long month
That continually queries the user to enter a valid day that is defined as a value greater than or equal to and less than or equal to the number of days in the month represented by year and month.
int queryforvalidmonth
That continually queries the user to enter a valid month day that is defined as a value greater than or equal to and less than or equal to
int queryforvalidyear
That continually queries the user to enter a valid year that is defined as a value greater than or equal to
int return days since epoch int year, int month, int day
That packages the statements in the function int main that computes and returns the number of days since January Once written and tested, replace the statements in the int main function with a call to this function.
At this point, your project should contain the following functions:
bool isleapyearlong year
int queryforlongstring prompt
int returndaysinyearlong year
int returndaysinmonth long year, long month
int main s that computes the number of days since the beginning of the epoch January
These functions should already be tested as working.
In this assignment, write functions with the prototype:
string returnmonthname long month :
That returns the name of the month represented by month. The function was presented in class and requires the use of a string array containing the names of each month.
Date returndatelong dayssinceepoch ;
That returns the date represented by dayssinceepoch. The function returns a variable of the abstract data type Date that is defined as:
struct Date
long year ;
long month ;
long day ;
i ;
To accomplish this task, first query the user to enter a year, month, day, compute the number of days since the beginning of our epoch, and display an appropriate message.
This is what the user might see when using the program:
Enter a year:
Enter a month:
Enter a day:
There are days between and
represents the date June
The bold values above are examples of what the user might type in response to the three queries or are a result of computation performed by the program,
Include one or more of the following functions:
int queryforvaliddaylong year, long month
That continually queries the user to enter a valid day that is defined as a value greater than or equal to and less than or equal to the number of days in the month represented by year and month.
int queryforvalidmonth
That continually queries the user to enter a valid month day that is defined as a value greater than or equal to and less than or equal to
int queryforvalidyear
That continually queries the user to enter a valid year that is defined as a value greater than or equal to
int returndayssinceepochint year, int month, int day
That packages the statements in the function int main that computes and returns the number of days since January Once written and tested, replace the statements in the int main function with a call to this function.
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