Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions