Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number of Mondays in a month
Message
De
20/10/2016 01:21:46
 
 
À
19/10/2016 20:31:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01642129
Message ID:
01642131
Vues:
80
>The application has to determine how many occurrences of a given day of the week occurred in a given calendar month.
>
>For example- How many Mondays (or any other specified day of the week) were there in February, 2016?
>I can see how to get the answer by looping through all the days in the month in question, but is there a slicker way?

Shouldn't be that hard, Bill

- Take the first day of the month
- Determine what day of the week it is, if not a Monday, advance n days until the first Monday of the month ( do not use a loop)
- Then see how many more days there are in that month
- integer division by 7
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform