Page 646 - Computer science 868 Class 12
P. 646

91                    }
                92              }

                93          }
                94       }
                95

                96       void output() // display output

                97       {
                98       System.out.println(sub);
                99          }

                100      }
                101

                102      class decoder_Main
                103      {

                104      public static void main()
                105      {

                106      decoder ob = new decoder(); // creating objects to invoke function
                107      ob.input();

                108      ob.compute();
                109      ob.output();

                110         }
                111      }

              Output of the preceding program is as follows:

              Enter The Code: 083088073
              Sxi


                Program 29     Write a program in Java to accept a string. Arrange all the letters of the string in an alphabetical
                               order. Now, insert the missing letters in the sorted string to complete all the letters between
                               first and last characters of the string.
                               Sample Input:  computer
                               Alphabetical order: cemoprtu
                               Sample Output: cdefghijklmnopqrstu

                 1       import java.util.*;

                 2       class strprogram2
                 3       {

                 4           public static void main()





                644644  Touchpad Computer Science-XII
   641   642   643   644   645   646   647   648   649   650   651