Here is the code that we wrote today:

void tenHi() {
  int i = 0;
  while(i < 10) {
    System.out.println("Hi " + i);
    i++;
  }
}
    
public String doubleChar(String str) {
  String retVal = "";
  int i = 0;
  while(i < str.length()) {
    retVal = retVal + str.charAt(i) + str.charAt(i);
    i++;
  }
  return retVal;
}

public int countHi(String str) {
  int retVal = 0;  //number of "hi"s we've seen
  int i = 0;
  while(i+1 < str.length()) {
    if(str.substring(i,i+2).equals("hi")) {
    //if((str.charAt(i) == 'h') && (str.charAt(i+1) == 'i')) {
      retVal++;
    }
    i++;
  }
  return retVal;
}