2023 Question 02 Write a modular C program to compute and display the day number in a year | Assignment Collections

Computer Science 2023 Question 02: Write a modular C program to compute and display the day-number in a year for a date that…

2023 Question 02 Write a modular C program to compute and display the day number in a year | Assignment Collections

Question 02: Write a modular C program to compute and display the day-number in a year for a date that is input at the keyboard. A day-number for a date is the number of days from 1st January of the date’s year to the date. For example: The day number of 3rd February is 34, the day number of 5th March is 64 if the year is a non-leap year; otherwise it is 65 (A leap year is a year that has 366 days; a non-leap year has 365 days).

 

Your program must check for input validity. It must display an appropriate error message and terminate if the three inputs for date (day, month, and year) do not form a valid date.

 

In addition to the main function your program must use the following functions:

·         A function that displays the following message to the user:

         “This program computes and displays the day number of a date input as:  day   month   year.”

·         A boolean function (implemented as an int function) that tests for input validity. The function returns 1 if the three inputs form a valid date; otherwise it returns zero. This function must not have printf or scanf calls.

·         A boolean function (implemented as an int function) that returns 1 if its parameter year is a leap year; otherwise it returns 0 (A leap year is a year that has 366 days). This function must not have printf or scanf calls.

·         An int function that returns the day-number of a particular date. This function must not have printf or scanf calls.

Note:

·         A year is a leap year if it is divisible by 400; otherwise if it is divisible by 4 and not divisible by 100.

·         Assume a year is between 1900 and 3000 inclusive, i.e., 1900 ≤ year ≤ 3000

·         Your program must be general.

·         For grading purposes, each non-main function must be written after the main.

·         Your program must behave as the sample program runs below.

·         You may use the table of day-numbers given below to test your program.

Sample program runs:

 

 

Date

Day number

Comment

February 29, 2015

invalid

2015 is not a leap year

March 27, 2015 (Fri)

Day 86

 

April 9, 2016 (Sat)

Day 100

2016 is a leap year

September 14, 2016 (Wed)

Day 258

 

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational