Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1.     // Define and Initialize Variables //
  2.    
  3.                                     // Assign Values to Each Weekday //
  4.     enum weekdays { Monday,         // Value of 0 //
  5.                     Tuesday,        // Value of 1 //
  6.                     Wednesday,      // Value of 2 //
  7.                     Thursday,       // Value of 3 //
  8.                     Friday,         // Value of 4 //
  9.                     Saturday,       // Value of 5 //
  10.                     Sunday  };      // Value of 6 //
  11.    
  12.     weekdays today;                 // Establish variable 'today' in weekdays enumeration //
  13.     today = Tuesday;                // Set the first day of the year //
  14.    
  15.     int d = 0 ;                 // Days //
  16.     int m = 0;                  // Months //
  17.    
  18.     // Main Program //
  19.    
  20.     while (m < 12)
  21.     {      
  22.         m = m + 1;
  23.        
  24.         if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
  25.         {
  26.             while (d < 31)
  27.             {
  28.                 d = d + 1;
  29.                
  30.                 static_cast <int> (today);
  31.                 int today;
  32.                 today = today + 1;
  33.                
  34.                 if (d == 7 && today == Monday)  
  35.                     {
  36.                         cout << m << "/" << d;
  37.                     }
  38.                
  39.             }
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement