Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

2. Day of the Week In homework 2 you wrote functions that allowed you to compute differenoes between dates These functions (as well as a

image text in transcribed
2. Day of the Week In homework 2 you wrote functions that allowed you to compute differenoes between dates These functions (as well as a new one) can be useful in other programs as well, so we can put the definitions of the functions in a file, julianc, with the prototypes in julian.h to make a small ibrary. For excample, in addition to other macros, julian.h might contain the following prototypes: int julian date (int day, int son, iat yr) /* Given: the day, month, year Returns: the julian date int days.in year(int yr) /e Given: the year Returns: the susber of days in the yoar int days.in month (int mon, int yr): / Given: the sonth and year Returns: the number of days in the month int is leap(int yr): /Given: a year Returos: TRUE if the year is a leap year, FALSE othervise We would like to write a program using the above library which will determine the day of the week (Sunday, Monday. Tuesday, etc.) for any date in the 21" century. We are given that 1 an 2000 was a Saturday. A sample execution of this program would look like Enter a date (aon, day, year) (EOF to quit): 4 13 2015 4/13/2015 is a Monday Enter date(o, day, year) (EOF to quit): 5 6 2015 5/6/2015 is a Vedcesday Enter date(mom, day, year) (EOP to quit)D Your task is to write the driver that implements this program DO NOT WRITE ANY OF THE ABOVE FUNCTIONS!t. You may just se those functions in your program You will ouly write the driver (main0), and any ADDITIONAL functione yo want, for this prograun. You can assume that the date the uer estered is always later thaa 1 Jan 2000. (To belp you out if you weed it, today's jalian date is 103) e a) Write the algorithm for the driver to kompute the day of the week given a date. b) write the code for main) MacBook Air

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions