/* ID: azafar_1 TASK: ride LANG: JAVA */ public class ride { public static void main(String[] args) { String phrase = new String ("This is a String test."); int phraseLength, middleIndex; String firstHalf, secondHalf, switchedPhrase; phraseLength = phrase.length(); middleIndex = phraseLength / 2; firstHalf = phrase.substring(0,middleIndex); secondHalf = phrase.substring(middleIndex, phraseLength); switchedPhrase = secondHalf.concat(firstHalf); System.out.println(); System.out.println("Original phrase: " + phrase); System.out.println("Length of the phrase: " + phraseLength + " characters"); System.out.println("Index of the middle: " + middleIndex); System.out.println("Character at the middle index: " + phrase.charAt(middleIndex)); System.out.println("Switched phrase: " + switchedPhrase); System.out.println(); System.exit(0); } }