Skip to content

Commit f60f410

Browse files
committed
beautify decrypt UI
1 parent 22d525f commit f60f410

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/main/java/App.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,19 @@ public static void main(String[] args){
4040

4141
}else if(option == 2){
4242
System.out.println("Enter the message to Decrypt : ");
43+
String message = myConsole.readLine(BLUE+"encryptedMessage"+GREEN+"@caesar:"+BLUE+"~$ "+NEUTRAL);
44+
System.out.println("\nEnter the shift key '1 - 25' :");
45+
int key = Integer.parseInt(myConsole.readLine(BLUE+"key"+GREEN+"@caesar:"+BLUE+"~$ "+NEUTRAL));
46+
myCaesar.setKey(key);
47+
myCaesar.decrypt(message);
48+
System.out.println(RED+"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"+NEUTRAL);
49+
System.out.println(BLUE+"Input String: "+GREEN+message);
50+
System.out.println(BLUE+"Decrypted String: "+GREEN+myCaesar.getDecryptedMsg());
51+
System.out.println(BLUE+"Shift/Decryption key : "+GREEN+myCaesar.getKey()+NEUTRAL);
52+
System.out.println(RED+"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"+NEUTRAL);
4353

4454
}else if(option == 3){
45-
System.out.println("Goodbye :)");
55+
System.out.println(RED+"Goodbye :)");
4656
running = false ;
4757
}else {
4858
System.out.println(RED+"Oops!, invalid Option :("+NEUTRAL);

0 commit comments

Comments
 (0)