help with returning a single value

I am working on this exercise



Write a function named daycount() that accepts a month, day, and year as its input arguments; calculates an integer representing the total number of days from the turn of the century to the date that's passedl and returns the calculated integer to the calling function. Assume each year has 365 days and each month has 30 days. Test your function by verifying the date 1/1/00 returns a day count of 1.


I have been watching tutorials and reading the beginners pdf on c++ and am still getting confused. if anyone can offer help with this exercise and help me to better understand whats being done and why. thank you!
Write a function named daycount()
daycount()

that accepts a month, day, and year
daycount(int month, int day, int year)

and returns the calculated integer to the calling function
int daycount(int month, int day, int year)

The calculation I assume you know how to do
1
2
3
4
int daycount(int month, int day, int year)
{
	return ?;
}
Last edited on
closed account (GADSLyTq)
When I started programming I had a difficult time writing code. What helped me was writing down the question and finding out test cases to solve the problem. I suggest doing the same. If you don't understand the question then do a test case. Try:
3/4/11
Calculate how many days have passed since 1/1/11 *assuming each month has 30 days and each year has 365.
Topic archived. No new replies allowed.