Class PE0019

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int[] DaysInMonth
      Stores the number of days for every month.
    • Constructor Summary

      Constructors 
      Constructor Description
      PE0019()
      A simple constructor to set number and title.
    • Method Summary

      Modifier and Type Method Description
      void prepare()
      Here the DaysInMonth are initialized.
      java.lang.String solve()
      Starting at Monday, 1.1.1900 it runs a loop by incrementing the current day of month and weekday.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DaysInMonth

        private int[] DaysInMonth
        Stores the number of days for every month.
    • Constructor Detail

      • PE0019

        public PE0019()
        A simple constructor to set number and title.
    • Method Detail

      • solve

        public java.lang.String solve()
        Starting at Monday, 1.1.1900 it runs a loop by incrementing the current day of month and weekday. If weekday equals 6 (Sunday) and the day of month it the first, the day is counted.
        Returns:
        the number of Sundays that are the 1st of a month