Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Write a method which is passed a String which returns true if the String contains a double letter or falseotherwise. 2) Write a method

1) Write a method which is passed a String which returns true if the String contains a double letter or falseotherwise.

2) Write a method which is passed a String. It returns the index of the last Roman Numeral (recall that the Roman Numerals are {'I', 'V', 'X', 'L', 'C', 'D', 'M'}) found in the String or -1 if no Roman Numeral is found in the String.

3) Write a method which is passed a String s and returns a new String that's the same as s, but with the first letter of each word capitalized. There is a static method in the Character class toUpperCase that is passed a char c. If c is a lower-case letter, it returns its upper case equivalent. If it's not a lower-case letter, it returns c.

4) Write a method appendIfMissing which is passed a String s and a String e (for ending). If s doesn't already end with e, the method returns a new String which consists of the contents of s concatenated with e. It returns s otherwise. For example, if s refers to the String "lightningbug" and e refers to the String "bug", the method returns "lightningbug". If s refers to the String "Airplane II", and e refers to the String ": the Sequel", the method returns "Airplane II: the Sequel".

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

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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. The title should identify the theory variables.

Answered: 1 week ago

Question

6. Does your speech have a clear and logical structure?

Answered: 1 week ago