Answer:
import java.util.Scanner;
public class CountT {
public static void main(String[] args) {
Scanner in = new Scanner (System.in);
System.out.println("Enter a word");
String word = in.nextLine();
//convert to all lower case
String str = word.toLowerCase();
int tcount = 0;
for(int i= 0; i<str.length(); i++){
if(str.charAt(i)=='t'){
tcount++;
}
}
System.out.println("Total number of ts: "+tcount);
}
}
Explanation:s