Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //melinda
- //11.18.15
- //Astropassword
- import java.util.Scanner;
- public class AstroPassword
- {
- public static void main(String[] args)
- {
- Scanner input = new Scanner(System.in);
- System.out.println("Please enter your zodiac sign:");
- String zodiacSign = input.nextLine();
- System.out.println("Please enter a color:");
- String color = input.nextLine();
- System.out.println("Please enter the year you were born:");
- int year = input.nextInt();
- int zodiacSignLength = zodiacSign.length();
- String passwordA = zodiacSign.substring(zodiacSignLength/2);
- String passwordB = color.substring(0,2);
- System.out.println("Your new password can be: " + passwordA + passwordB + year);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement