Hi,
I need urgent help on my assignment...please don't assume I'm asking you to write my program..I just need a guide to start. I've lost my USB so I lost all my programs, and all the notes etc from class and I've been sick lately so haven't been attending class either...so I'm kinda..well really really lost...With that being said, here is the assignment :D
Write a program that prints the day number of the year, given the date in the form month-day-year. For example, if the input is 1-1-2006, the day number is 1; if the input is 12-25-2006, the day number is 359. The program should check for a leap year.
And This is what I have so far...
#include<iostream>
using namespace std;
int main()
{
date;
cout << "Please enter a date (mm-dd-yyyy): ";
cint >> date;
if ( date / 4 == 0 && date / 100 != 0)
{
/*leap year*/
}
}
And now I'm confused as to what I should do...I need to divide the year to check for leap year...but the way I have my date, it won't work out...so, can someone guide me a bit ?
Thanks...