Levels Tought:
University
Teaching Since: | Apr 2017 |
Last Sign in: | 346 Weeks Ago, 1 Day Ago |
Questions Answered: | 9562 |
Tutorials Posted: | 9559 |
bachelor in business administration
Polytechnic State University Sanluis
Jan-2006 - Nov-2010
CPA
Polytechnic State University
Jan-2012 - Nov-2016
Professor
Harvard Square Academy (HS2)
Mar-2012 - Present
(Data Processing)
a. A clever and simple method of preparing to sort dates into ascending (increasing) or descending (decreasing) order is to convert a date in the form month/day/year into an integer number with the formula date = year × 10000 + month × 100 + day. For example, using this formula, the date 12/6/1988 converts to the integer 19881206, and the date 2/28/2010 converts to the integer 20100228. Sorting the resulting integer numbers puts dates into the correct order automatically. Using this formula, write a function named convertdays() that accepts a month, day, and year; converts the passed data into a single date integer; and returns the integer to the calling function.
b. Include the convertdays() function written for Exercise 7a in a working program. The main() function should call convertdays() correctly and display the integer the function returns.
#in-----------clu-----------de -----------"st-----------daf-----------x.h-----------" #-----------inc-----------lud-----------e #-----------inc-----------lud-----------e u-----------sin-----------g n-----------ame-----------spa-----------ce -----------std-----------; v-----------oid----------- so-----------rt_-----------dat-----------e(c-----------har----------- da-----------te[-----------][1-----------3],----------- in-----------t n-----------) {----------- in-----------t d-----------, m-----------, y-----------; l-----------ong----------- t_-----------dat-----------e, -----------dat-----------e1[-----------20]-----------, t-----------emp-----------; f-----------or -----------(in-----------t