HarrJ

B8 Day8 if else sample

Sep 19th, 2022
1,134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. package mattroseb8wk2;
  2. import java.util.Scanner;
  3.  
  4. public class Day08A {
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         String pinCode;
  8.         String correctCode = "345678";
  9.        
  10.         System.out.print("Enter PIN code : ");
  11.         pinCode = sc.nextLine();
  12.        
  13.         //using 7F file as an inspiration
  14.         if (pinCode.equals(correctCode)) {
  15.             System.out.println("Authentication complete");
  16.         } else {
  17.             System.out.println("Please try again");
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment