CS 1713 Introduction to Programming II Spring 2012 Daily Answers


Class 9:

  1. isVisible
  2.      public static void printReverse(String s) {
             for (int i=s.length()-1; i>=0; i--)
                 System.out.print(s.charAt(i));
         }
    
  3.      public static String getReverse(String s) {
             String t = "";
             for (int i=s.length()-1; i>=0; i--)
                t = t + s.charAt(i);
             return t;
         }
    
  4. This one will be asked again.
    Think about using indexOf and substring.
    Also, look up StringTokenizer.