
560 CHAPTER 8 Single-Dimensional Arrays
EXERCISES,PROBLEMS, AND PROJECTS
method returns true; otherwise, it returns false. For this, we
suggest the following method to help you:
■
Write an int-returning method that takes a String and a char as
parameters and returns how many times that char appears in
the String; you can convert the String to an array of chars and
loop through it, or use another strategy of your choice.
❑ A method counting and returning the number of IMG tags
overall.
Write a client class to test all the methods in your class.
68. Write a class encapsulating the concept of converting integer grades
to letter grades (A, B, C, D, or F),