Page 550 - Cs_withBlue_J_C11_Flipbook
P. 550

Variable Description
                 NAME         TYPE                                       DESCRIPTION
                                                                  rd
                                                            nd
               c           int          Serves as a counter for 2  and 3  digits
               m           int          Stores the number being computed in integer form
               x           String       Stores the original string
               w           String       Stores the number to be computed in string form
               w2          String       Stores the clear text before case conversion

               sub         String       Stores the clear text after case conversion
               ch          char         Stores a character to the original string
               ch2         char         Stores converted character
               i, k        int          Control variables loop
               w3          String       Stores a string with extra space

               len         int          Stores the length of the string with extra space (w3)
               l           int          Stores length of the original string




                Program 25     Design a class Ddate that takes a future date a (any date after 01-01-2023) and prints what
                               day it will be (given the day of 01-01-2023)
                               class name           :   Ddate
                               Data Members
                               String s             :   to store the future date in DD-MM-YYYY format
                               String f             :   to store the day of 01-01-2023
                               Member Functions
                               Ddate()              :   constructor to initialise data members to null
                               void accept()        :   to accept the values of s and f
                               void find_day()      :   to find and display the day of the future date


                 1       import java.util.*;
                 2       class Ddate

                 3       {
                 4           String s,f;

                 5           Ddate()
                 6           { s=f="";

                 7           }
                 8

                 9           void accept()
                10           {

                11               Scanner sc= new Scanner(System.in);
                12               System.out.print("Enter the Date in DD-MM-YYYY format : ");



                548548  Touchpad Computer Science-XI
   545   546   547   548   549   550   551   552   553   554   555