It has been 6 months since #28 so I decided to put my rarely-used ubuntu forums account to good use and create #29!
We welcome you to the 29th Beginners programming challenge!
The task is simple, create a converter between the Gregorian Calendar and the disused French Revolutionary Calendar
It only has to convert from Gregorian to French Revolutionary
It should take input in the following formats:
1) Through a command line interface through this format (<program name> -i)
2) Through a file printing the output through the screen in this format (<program name> <file name>)
3) Through a file exporting the output to another format through this format (<program name> <file name> -o <output file name>)
A fixed arithmetic rule for determining leap years was proposed in the name of the Committee of Public Education by Gilbert Romme on 19 Floréal An III (8 May 1795). The proposed rule was to determine leap years by applying the rules of the Gregorian calendar to the years of the French Republic (years IV, VIII, XII, etc. were to be leap years) except that year 4000 (the last year of ten 400-year periods) should be a common year instead of a leap year.
When entering the date into the program it should accept the following format Decade (I/II/III), (day) de (month) de l'Annee (year) de la Revolution or La Fete (<COMPLEMENTARY DAY: look here>) de l'Annee (year) de la Revolution
1) Export the year in roman numerals
2) Convert both ways
Any overly obfuscated code will be immediately disqualified without account for programmers skill. Please remember that these challenges are for beginners and therefore the code should be easily readable and well commented.
Any non-beginner entries will not be judged. Please use common sense when posting code examples. Please do not give beginners a copy paste solution before they have had a chance to try this for themselves.
If you need help feel free to ask around on irc.freenode.net channel #ubuntu-beginners-dev