Advertisement
ZhenghaoZhu

AstroProject

Nov 22nd, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class AstroProject{
  4.   public static void main (String []args){
  5.     Scanner input = new Scanner(System.in);
  6.     System.out.println("Could you give me your astrological sign?");
  7.     String astro = input.nextLine();
  8.     System.out.println("Could you give me your favorite fruit?");
  9.     String fruit = input.nextLine();
  10.     System.out.println("Could you give me a 2 digit number?");
  11.     int year = input.nextInt();
  12.     int astrolength = astro.length();
  13.     int fruitlength = fruit.length();
  14.     String astro2 = astro.substring(astrolength/2);
  15.     String fruit2 = fruit.substring(fruitlength/2);
  16.     String pass = astro2+fruit2+year;
  17.     System.out.println("Your new password is: " + pass);  
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement