Ad
Code
Diff
  • public class Encrypt {
      
      public static String encryptByVowels(String str) {
        String newS = "";
    		int cont = 0;
    		for(char c: str.toLowerCase().toCharArray()) {
    			if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
    				cont++;
    		}
    		for(char c: str.toCharArray()) {
    			int newChar = (int) c;
    			if(c != ' '){
            newChar = c+cont;
            if(newChar > 90 && newChar < 97)
    				  newChar+=(97-newChar);
            if(newChar > 122) {
              newChar = 64 + newChar%122;
              if(newChar > 90 && newChar < 97)
                newChar+=(97-newChar);
            }
          }
    			newS+=""+(char)newChar;
    		}
    		return newS;
      }
    }
    • public class Encrypt {
    • public static String encryptByVowels(String str) {
    • return null;
    • String newS = "";
    • int cont = 0;
    • for(char c: str.toLowerCase().toCharArray()) {
    • if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
    • cont++;
    • }
    • for(char c: str.toCharArray()) {
    • int newChar = (int) c;
    • if(c != ' '){
    • newChar = c+cont;
    • if(newChar > 90 && newChar < 97)
    • newChar+=(97-newChar);
    • if(newChar > 122) {
    • newChar = 64 + newChar%122;
    • if(newChar > 90 && newChar < 97)
    • newChar+=(97-newChar);
    • }
    • }
    • newS+=""+(char)newChar;
    • }
    • return newS;
    • }
    • }
Code
Diff
  • public class Encrypt {
      
      public static String encryptByVowels(String str) {
        return null;
      }
    }
    • public class Encrypt {
    • public static String encryptByVocals(String str) {
    • public static String encryptByVowels(String str) {
    • return null;
    • }
    • }
Code
Diff
  • public class Encrypt {
      
      public static String encryptByVocals(String str) {
        return null;
      }
    }
    • public class Encrypt() {
    • public class Encrypt {
    • public static String encryptByVocals(String str) {
    • return null;
    • }
    • }