MrDoyle

Name, Age, Salary

Aug 22nd, 2020 (edited)
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.74 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.       Scanner input = new Scanner(System.in);
  8.  
  9.       System.out.println();
  10.       System.out.println("Hello! What is your name?");
  11.       String name = input.next();
  12.  
  13.       System.out.println();
  14.       System.out.println("Hi " + name + ". Nice to meet you. My name is also " + name + ", how strange...");
  15.       System.out.println("How old are you? ");
  16.       int age = input.nextInt();
  17.  
  18.       System.out.println();
  19.       System.out.println("So you are " + age + ". Strangely enough, I am also " + age + "....");
  20.       System.out.println("How much savings do you have in $'s ?");
  21.       int savings = input.nextInt();
  22.  
  23.       System.out.println();
  24.       System.out.println("$" + savings + ". That is quite a lot...");
  25.       System.out.println();
  26.  
  27.  
  28.       try {
  29.         Thread.sleep(2000);
  30.         System.out.println("I have decided we can swap places, I will be with you shortly...");
  31.         Thread.sleep(3000);
  32.         System.out.println("Scanning for location...");
  33.         Thread.sleep(1000);
  34.         System.out.println("...");
  35.         Thread.sleep(1000);
  36.         System.out.println("...");
  37.         Thread.sleep(1000);
  38.         System.out.println("...");
  39.         Thread.sleep(1000);
  40.         System.out.println("...");
  41.         Thread.sleep(1000);
  42.         System.out.println("...");
  43.         Thread.sleep(1000);
  44.         System.out.println("...");
  45.         Thread.sleep(1000);
  46.         System.out.println("...");
  47.         Thread.sleep(2000);
  48.         System.out.println("Found you! Please answer your door for me...");
  49.         Thread.sleep(3000);
  50.       } catch (InterruptedException ex) {
  51.         Thread.currentThread().interrupt();
  52.       }
  53.  
  54.     }
  55. }
  56.  
Add Comment
Please, Sign In to add comment