Advertisement
MelindaElezovic

AstroPassword

Nov 22nd, 2015
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. //melinda
  2. //11.18.15
  3. //Astropassword
  4. import java.util.Scanner;
  5.  
  6.   public class AstroPassword
  7. {
  8.   public static void main(String[] args)
  9.   {
  10.     Scanner input = new Scanner(System.in);
  11.     System.out.println("Please enter your zodiac sign:");
  12.     String zodiacSign = input.nextLine();
  13.     System.out.println("Please enter a color:");
  14.     String color = input.nextLine();
  15.     System.out.println("Please enter the year you were born:");
  16.     int year = input.nextInt();
  17.     int zodiacSignLength = zodiacSign.length();
  18.     String passwordA = zodiacSign.substring(zodiacSignLength/2);
  19.     String passwordB = color.substring(0,2);
  20.     System.out.println("Your new password can be: " + passwordA + passwordB + year);
  21.   }
  22.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement