Guest User

Untitled

a guest
Jan 12th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. i see 1 hickup
  2.  
  3.  
  4. some month have 30 days, others 31
  5.  
  6.  
  7. i see that as being the biggest obstacle of your assignment
  8.  
  9.  
  10. general guidelines are:
  11.  
  12. for (months =0; months <= 11; months++)
  13. {
  14.     if (month == 0)
  15.         cout << "January" << endl;
  16.     else if (month == 1)
  17.         cout << "February" << endl;
  18.     ...
  19.  
  20.  
  21.  
  22.     cout  << "Sun Mon Tue Wed Thu Fri Sat" << endl;
  23.  
  24.    
  25.     INT switchLineCounter = 0;   //when this value reaches 6, you cout << endl;  so that the starts again on a sunday  
  26.  
  27.     for (days =0; days <= 31; days++)
  28.     {
  29.         if (switchLineCounter == 6)
  30.             cout << endl;
  31.  
  32.         if ( (month == feburary || month == april || month == june || month == september || month == november )  &&  days == 30 )
  33.             break;
  34.         else
  35.         {  
  36.             cout << days << " ";
  37.             switchLineCounter++;
  38.                
  39.         }
  40.  
  41.     }
  42.  
  43.  
  44.    
  45.  
  46. cout << endl << endl << endl;
  47.  
  48. }
Add Comment
Please, Sign In to add comment