Interested in a PLAGIARISM-FREE paper based on these particular instructions?...with 100% confidentiality?

Order Now

Write a class City. The constructor takes a String parameter. This is provided for you. You need to copy the starter code from Codecheck You provide the methods: public String getCity() gets the name of the city public boolean doubleLetter() determines if the city name contains a double letter. Returns true is it does. Otherwise it returns false. Note: double letter means two of the same letter next to each other. The test is case-insensitive. For example Seacliff and Lloydton have a double letters. Saratoga does not. Hints The loop needs to stop on the next to the last letter (to avoid StringIndexOutOfBoundsException) Do not change the instance variable

Write a class City. The constructor takes a String parameter. This is provided for you. You need to copy the starter code from Codecheck

You provide the methods:

  • public String getCity() gets the name of the city
  • public boolean doubleLetter() determines if the city name contains a double letter. Returns true is it does. Otherwise it returns false. Note: double letter means two of the same letter next to each other. The test is case-insensitive. For example Seacliff and Lloydton have a double letters. Saratoga does not.

Hints

  • The loop needs to stop on the next to the last letter (to avoid StringIndexOutOfBoundsException)
  • Do not change the instance variable

Interested in a PLAGIARISM-FREE paper based on these particular instructions?...with 100% confidentiality?

Order Now