Strings and Characters Practice#
Download starter code
This question is to assess your understanding of how to work with String
variables and for
loops.
Write code that takes a String message
and a character letter
and counts the number of times letter
occurs within message
and prints that result to the console.
For example, if message
holds "Hello"
and letter
holds l
, your program should produce the output 2
because there are two occurrences of l
in the String Hello
.