Fibonacci

Everyone who has read the book or seen the film Da Vinci Code has heard about the Fibonacci sequence. The sequence looks a bit like this: \[1,1,2,3,4,7,11,\ldots\] In recent years a zero has been added to the front of the sequence, and it it this sequence I will be programming. The Fibinacci sequence can be …
Continue reading Fibonacci

GUI Refinements – Today

This entry is part 13 of 13 in the series
Zellers Algorithm

My final refinement (for the moment) is that, I want today’s date to be the default date. To do this I need to import two libararies: I then need to get the current date: In order to get each part of the date (day, month, year), i will simply use the SimpleDateFormat library, and create …
Continue reading GUI Refinements – Today

GUI – Refinements – Error Messages

This entry is part 11 of 13 in the series
Zellers Algorithm

The next refinement is simple. I want the output box to change colour, when the output of the calculation contains the word ‘Error’. How I have decided to handle this is by creating a new String before sending setting it as the content of the JTextField element. I have also decided to add a few …
Continue reading GUI – Refinements – Error Messages

GUI – Refinements – ComboBoxes

This entry is part 10 of 13 in the series
Zellers Algorithm

The first refinement i wish to make is to make the inputs for Day and Month to be ComboBoxes. In order to do this I first need to create two arrays containing all the values for the days(0 – 31) and months(“—” to “December”). The arrays will both store these values as strings and then …
Continue reading GUI – Refinements – ComboBoxes

validDate Revisited – Java

This entry is part 8 of 13 in the series
Zellers Algorithm

With the updated Python function, comes an updated Java function, the code now looks like this, similar to the Python function there are two new checks and a final check that daysInMonth is not still zero: With this function working correctly, I can now continue with developing the GUI.