(String[] args)
| 3 | public class SwitchingLetters { |
| 4 | |
| 5 | public static void main(String[] args) { |
| 6 | |
| 7 | Scanner keyboard = new Scanner(System.in); |
| 8 | |
| 9 | System.out.println("Please enter two numbers:"); |
| 10 | int index1 = keyboard.nextInt() - 1; |
| 11 | int index2 = keyboard.nextInt() - 1; |
| 12 | |
| 13 | keyboard.nextLine(); |
| 14 | System.out.println("Please enter a sentence:"); |
| 15 | String sentence = keyboard.nextLine(); |
| 16 | |
| 17 | System.out.println("The new sentence:\n" + switchLetters(index1, index2, sentence)); |
| 18 | } |
| 19 | |
| 20 | /* Switches letters according to given indexes. */ |
| 21 |
nothing calls this directly
no test coverage detected