Created
October 20, 2013 13:39
-
-
Save fado/7069798 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package uk.ac.qub.programming; | |
import java.util.Scanner; | |
public class Obfuscate { | |
public static void main(String[] args) { | |
String userInput = ""; | |
String output = ""; | |
Scanner input = new Scanner(System.in); | |
System.out.println("Enter your name: "); | |
userInput = input.nextLine(); | |
for (int counter = 0; counter < userInput.length(); counter++) { | |
if (userInput.charAt(counter) == ' ') { | |
output += " "; | |
} else { | |
output += "*"; | |
} | |
} | |
System.out.println(output); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment