I would throw the code away and start again.

Get first char, get last char, get all chars in between. Methods in the String class can do this
Convert first char to uppercase, convert last char to...