Jan Return 1

State: at the start of class, people do not remember how to write a “for” loop and could barely write an “if” statement.

  1. Print all of the numbers 1 to 100.

  2. Except print * instead of multiples of 13.

  3. Count from 50 down to 10.

  4. Print * on multiples of 7.

  5. Oops, you should also print * for multiples of 5.

  6. How many digits in an integer?

     public static int countDigits (int n) {
      // ... think of more than one way ...
     }
    
  7. Given the String below, how do you get the letters “eLsi”?

     String p = "SamueLsiLV";
    
  8. Count how many times the letter “s” appears in a string. Try writing two different kinds of solution.

     public static int countS(String x) { ... }
    
  9. Given a string, how many times does it contain “bat” either forward or backward?

     public static int countBat(String x) { ... }
    
  10. Do the first row of CodingBat String-2.

Last modified August 18, 2023: 2022-2023 End State (7352e87)