Write a method called countA that accepts a String parameter and returns the number of times the character 'A' is found in the string.

What will be an ideal response?


```
public int countA(String text)
{
int count = 0;
for (int index = 0; index < text.length(); index++)
if (text.charAt(index) == 'A')
count++;
return count;
}

```

Computer Science & Information Technology

You might also like to view...

The method, my first method, which is automatically created, is a(n) __________________-level method.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

HTML version ____ added support for style sheets to give Web designers greater control over page layout and appearance.

A. 1.0 B. 2.0 C. 3.0 D. 4.01

Computer Science & Information Technology

When creating presentations, remember the KISS principle: Keep It ________!

A) Short and Snappy B) Snappy and Simple C) Simple and Showy D) Short and Simple

Computer Science & Information Technology

The ____ refers to the order in which the focus moves from one control to another control when a user presses the Tab key.

A. tab alignment B. tab stop C. tab order D. tab focus

Computer Science & Information Technology