• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to print all the pallindromic days in a year

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello I want To ask a method how to print no of pallindromic days in year ??
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since, I believe, the term "palindrome" applies to strings and not to dates, I am assuming that you want a specific string representation of the dates?

Anyway, what have you tried? A straightforward implementation would be to go through all the days of the year, convert to string, and check if it is a palindrome. Of course, that's a very high level description -- please clarify the specific problem you are having.

Henry
 
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too have no idea what a palindromic day of the year is. Are you just talking about the day and the month as numbers?

E.g 01/10 is the first of October (or the 10th of January if you're American). This is a palindrome.

Whatever your definition of a palindromic day of the year is you need to break the problem down into smaller parts. You can have a method that checks if a String is a palindrome, and a method that loops through all the days of the year and passes them to the palindrome checker.
 
Marshal
Posts: 8857
637
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kislaya Pant wrote:pallindromic days in year

As guys already mentioned, most important part is to define unambiguous requirements first. By reading your post I understand, that you need to find how many pallindropic dates days are in the year. Being a bit silly, per month you can have 2 pallindromic days: 11 and 22. This number multiplied by amount of month you'd get 24. But this is surely is not what could guarantee you a good mark. I believe guys were correct by saying that likely it needs to look similar to 01/10.

1. So, first step is clearly identify the problem what do you call pallindromic day and provide couple of examples: one pallindromic day and another non pallindromic day.
2. Bear in mind, it will be important how you write your date 10.01 or 10/01 or 10-01 or 1001, maybe 10 January (this question should be answered along with provided examples).
3. After you clearly understand requirements, you start describing your program in plain english by omitting any technical terminology. This FAQ (<- link to click on) will help you to achieve that.

I believe you've been tought how to write pseudo code, so, probably would be a good idea if you'd come up with it first and post here, so you could convince everyone that you understand fully what your problem you need to solve is.

And welcome to the Ranch
 
reply
    Bookmark Topic Watch Topic
  • New Topic