Jan Review 20

  1. Change “snow” to “ice”, but only when it appears between “December” and “February”. To simplify, you may assume that both December and February appear in the string, and December comes before February.
System.out.println(winter("snow December snow ice snow February snow"));
==> "snow December ice ice ice February snow"
  1. Create a ASCII tree. Given:

    • height of whole tree (height >= 6)
    • width of crown at the top (width odd)
    • trunk is always 4 lines tall and 3 characters wide
    • width of crown increases by two “*” each line between bottom and top of crown (then decreasing halfway in between)

    Example:

         tree(10,5)
         ==>
                 *****
                *******
               *********
               *********
                *******
                 *****
                  ***
                  ***
                  ***
                  ***
Last modified August 18, 2023: 2022-2023 End State (7352e87)