Question: Solve the following question in Java. Don't forget the second part of the question. Question 4*: [5 marks] Write a class named CapitalsCounter that implements
Solve the following question in Java. Don't forget the second part of the question.

Question 4*: [5 marks] Write a class named CapitalsCounter that implements a method named countCaps to return the number of capital letters within a String, as done in this python snippet (hint: use Character.isUpperCase(): def countCaps (s): count0 for character in s: if character.isupper ) countcount + 1 return count Write a main method to check whether or not the countCaps method correctly returns 5 when given the the string "IHaveFiveCaptialLetters". It should print":)" if successful, or "(" if failed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
