Join 132,332 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,098 people online right now. Registration is fast and FREE... Join Now!
thanks for those people who reply to my previous post. i hope you can still help me.:-) can you please write a code about inputing the date, month, year, and display the week and day. and the if the user input three zero's. it will display already the result.
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.
int months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; if( yy % 4 == 0 ) months[1] = 29; for( int i = mm-1; i > 0; i-- ) { a += months[i-1]; } cout << a + dd; //outputs the day of the year
return 0; }
This shows the day of the year it is. Thats all I'm helping you with. Besides, I dont know how to show the day of the week...
int months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; if( yy % 4 == 0 ) months[1] = 29; for( int i = mm-1; i > 0; i-- ) { a += months[i-1]; } cout << a + dd; //outputs the day of the year
return 0; }
This shows the day of the year it is. Thats all I'm helping you with. Besides, I dont know how to show the day of the week...
can you please refer to my code.
CODE
#include<iostream> #include<cstdlib> using namespace std;
int DetermineDayWeek(int, int, int);
int dd, mm, yy, a = 0; int main() { do { cout << "Enter Day: " << endl; cin >> dd; cout << "Enter Month: " << endl; cin >> mm; cout << "Enter Year: " << endl; cin >> yy;