MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / main

Method main

Programs/CeaserCipher.java:6–27  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

4
5public class CeaserCipher {
6 public static void main(String[] args) {
7 System.out.println("""
8 --------------------------------
9 CEASER CIPHER ENCRYPT/ DECRYPT
10 --------------------------------
11 """);
12 Scanner sc = new Scanner(System.in);
13 System.out.println("Encrypt or Decrypt:\n 1- Encryption\n 2- Decryption");
14 int type = sc.nextInt();
15 for (int j = 1; j > 0; j++) {
16 if (type == 1) {
17 ceaserCipherEncryption();
18 break;
19 } else if (type == 2) {
20 ceaserCipherDecryption();
21 break;
22 } else {
23 System.out.print("Please enter a valid number (1 or 2): ");
24 type = sc.nextInt();
25 }
26 }
27 }
28 public static void ceaserCipherEncryption() {
29 Scanner textInput = new Scanner(System.in);
30 System.out.print("PlainText: ");

Callers

nothing calls this directly

Calls 3

printMethod · 0.80

Tested by

no test coverage detected