Write a code fragment that determines and prints the number of times the character 'z' appears in a String object called name.
What will be an ideal response?
```
int count = 0;
for (int index = 0; index < name.length(); index++)
if (name.charAt(index) == 'z')
count++;
System.out.println("The character \'z\' appears "
+ count + " time(s)");
```
Computer Science & Information Technology
You might also like to view...
The integrity of the data in a table can be checked by using queries that count the instance of certain fields to determine if the same record appears twice in a table
Indicate whether the statement is true or false
Computer Science & Information Technology
The future value for a loan is ALWAYS zero
Indicate whether the statement is true or false.
Computer Science & Information Technology