Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is an Intro to JAVA Course I am stuck below on finishing the public int getECount() & public String initials() please see below instructions.

This is an Intro to JAVA Course

I am stuck below on finishing the public int getECount() & public String initials() please see below instructions. Code I have is below and help would be appreciated thank you!

image text in transcribed

private String text; public LoopyText(String theText) { text = theText; } public String getText() { return text; } public String getUpperCase() { String upper = ""; for (int i = 0; i

public boolean isUpperCase(String str) { return Character.isUpperCase(str.charAt(0)); }

public int getECount() {

} public String initials () { } }

Complete the class LoopyText which has a constructor that takes a String of text. Implement the following methods. public String getText () returns the text public string getUpperCase) gets a String consisting of the uppercase letters in the text. You are provided with a helper method, isUpperCase () which takes a String consisting of one character public int getECount ) gets the number of e's in the String, either upper or lower case. Do not change the instance variable public String initials ) that returns a string consisting of the first character of every word in the string. If the string is the empty string, return the empty String. Hint: Each word after the first is preceded by a space. You can use the String method indexof (" ", fromIndex) to control the loop and to determine where a new word starts. Remember indexOf returns -1 if the space is not in the search string

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions