Padd Solutions

Converted by Falcon Hive

import java.util.Scanner;

public class PassWord
{
    public static void main (String[] args)
    {
        Scanner scan = new Scanner (System.in);
       
        System.out.print ("Enter a secret message: ");
       
        String message = scan.nextLine ();
       
        String encrypted = message.replace ('l', '%');
        encrypted = encrypted.replace ('v', '!');
        encrypted = encrypted.replace ('y', '*');
        encrypted = encrypted.replace ('p', '&');
        encrypted = encrypted.replace ('m', '#');
        encrypted = encrypted.replace ('s', '$');
       
        System.out.println ("This is your encrypted message: ");
       
        System.out.println (encrypted);
       
        System.out.println ("Okay, it's not so secret anymore, isn't it?! Now type it again if you dare...");
       
        message = scan.nextLine ();
       
        String encrypted2 = message.replace ('%', 'l');
        encrypted2 = encrypted.replace ('!', 'v');
        encrypted2 = encrypted.replace ('*', 'y');
        encrypted2 = encrypted.replace ('%', 'p');
        encrypted2 = encrypted.replace ('#', 'm');
        encrypted2 = encrypted.replace ('$', 's');
       
        System.out.print ("Congratulatons, you just got hacked. What an idiot. Your secret message is obviously ");
        System.out.print (encrypted2);
    }
}

(0) Comments

Post a Comment