We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
can someone help me write a C++ program that dispays the day of the week of a particular date that has been entered e.g. the date is 12/02/2000,the program displays both the date and the day of the week of that date.
void main(void) { cout << DeduceDateDetails("12/02/2000"); }
There's the starting point. I'll leave it to you to fill in the remaining missing detail.
I guess you're looking for something like this:
en.wikipedia.org/.../Calculating_the_day_of_the_week
Note that C51 is not a C++ compiler!
Search for "Zeller's congruence".
(I've always wondered how a programming 101 student with a generic homework question stumbles across the Keil web site in the first place. Did Keil bump up their Google rank so that any search for "C++ questions" puts us in the top five hits or something?)
"I've always wondered how a programming 101 student with a generic homework question stumbles across the Keil web site in the first place."
Me too - especially as there must be plenty more sites that have far more obviously and directly relevant answers.
When I were a lad, one of our first class assignments at university was to find out all we could about some entirely unrelated subject given at random by the lecturer. The whole point of the exercise was to get us to practice how to use the research facilities effectively. And that meant physically walking to the library, using the card index, microfilm, journals, abstracts, etc - there was no Google in them days!
www.8052.com/.../read.phtml
Clearly kids o' today need a lot more practice in how to research effectively...
You first have to do your own research, before you can start to think about being more efficient.