Page 504 - computer science (868) class 11
P. 504

47               v=v%7;
                48               System.out.println("Day as on "+s+" is : "+day[v]);

                49           }
                50

                51           public static void main()
                52           {

                53               Ddate ob=new Ddate();
                54               ob.accept();

                55               ob.find_day();
                56           }

                57       }


              The output of the preceding program is as follows:
              Enter the Date in DD-MM-YYYY format : 04-06-2019
              Enter the Day of 1st January 2023 : Tuesday
              Day as on 04-06-2023 is : TUESDAY


                                                         Variable Description
                 NAME         TYPE                                       DESCRIPTION
               s           String       To store the future date in DD-MM-YYYY format
               f           String       To store the day of 01-01-2019

               mon[]       int          Array to store number of days in each month
               day[]       String       Array to store each day of the week
               d           int          Stores the DD portion of s
               m           int          Stores the MM portion of s
               y           int          Stores the YYYY portion of s

               tot         int          To calculate and store the number of days between s and 01-01-2019
               v           int          To find the position of the dates in the array day[]


























                502502  Touchpad Computer Science-XI
   499   500   501   502   503   504   505   506   507   508   509