@@ -0,0 +1,968 @@
+/*%0A * 1.5 Write a method to replace all spaces in a string with %E2%80%98%2520%E2%80%99.%0A */%0A%0Aimport java.util.Scanner;%0A%0Apublic class Solution %7B%0A%09%0A%09// With new String object%0A%09public static String replaceAllSpaces(String inputString) %7B%0A%09%09String outputString = %22%22;%0A%09%09for (int i = 0; i %3C inputString.length(); ++i) %7B%0A%09%09%09if (inputString.charAt(i) == ' ') %7B%0A%09%09%09%09outputString += %22%2520%22;%0A%09%09%09%7D%0A%09%09%09else %7B%0A%09%09%09%09outputString += inputString.charAt(i);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return outputString;%0A%09%7D%0A%09%0A%09// Without new String object%0A%09public static String replaceAllSpaces_alt(String inputString) %7B%0A%09%09for (int i = 0; i %3C inputString.length(); ++i) %7B%0A%09%09%09if (inputString.charAt(i) == ' ') %7B%0A%09%09%09%09inputString = inputString.replaceAll(%22 %22, %22%2520%22);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return inputString;%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09Scanner read = new Scanner(System.in);%0A%09%09%0A%09%09String input = read.nextLine();%0A%09%09input = replaceAllSpaces_alt(input);%0A%09%09%0A%09%09System.out.println(input);%0A%09%09%0A%09%09%0A%09%09// Close scanner%0A%09%09read.close();%0A%09%7D%0A%7D%0A

Create 1.5.java