Professional Documents
Culture Documents
import java.util.Scanner;
} //End of main
Your phrase with w 'masked' is: Where $ere they $hen $e left
Your phrase with w removed is: Where ere they hen e left
The number of w's in your phrase are 3
-------------------End Sample Run#4 ____________________________*/
package edu.foothill.labs_cs1a;
scanner.close();
}
// method definitions:
public static char getKeyCharacter() {
String str;
do {
System.out.print("Please enter a SINGLE character to act as key: ");
str = scanner.nextLine();
} while (str.length() != REQUIRED_KEY_LENGTH);
return str.charAt(0);
}
do {
System.out.println("Please enter a phrase or sentence "
+ ">= "+ MIN_STR_LEN
+ " and <= " + MAX_STR_LEN + " characters: " );
str = scanner.nextLine();
} while ( str.length() < MIN_STR_LEN || str.length() > MAX_STR_LEN );
return str;
}
return result;
}
return result;
}
# fs: 7
------------------------------------------------------------------------ */