Question: Finish the following methods in java: /* returns the index of the first Roman Numeral in s or -1 * if s contains no Roman

Finish the following methods in java:

/* returns the index of the first Roman Numeral in s or -1 * if s contains no Roman Numerals */

public static int indexOfFirstRomanNumeral(String s) {

return -1; }

/* returns the index of the first occurrence of a roman numeral * in s starting from index startPosition or -1 if * there are no roman numerals in s at index startPosition or later * notice that this method has the same name as the previous * one, but that it takes a different number of arguments. * This is perfectly legal in Java. It's called "method overloading" */

public static int indexOfFirstRomanNumeral(String s, int startPosition) { return -1; }

/* returns the index of the last occurrence of a roman numeral in * s or -1 if s contains no roman numerals */

public static int indexOfLastRomanNumeral(String s) { return -1; }

/* returns true if the first, last, and middle letter of s is the * same ignoring case or false otherwise. * Returns false if s is shorter than 3 characters * * (Note: when there are an odd number of letters in a word, * for example, the word radar, it's clear what the middle * letter is. What would it mean to be the middle letter * for a word with an even number of letters?) */

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!