Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class gettingback {
  5. public static void main(String[] args) {
  6.  
  7. //declare variables
  8. Scanner input = new Scanner(System.in);
  9. float option1;//first user input option
  10. float option2;//second user input option
  11. float option3;//second user input option
  12. float option4;//second user input option
  13. float result;
  14. correctname = 'andre';
  15. float option5 =
  16.  
  17.  
  18. System.out.println("What is your name?");
  19. String name = input.next();
  20.  
  21. if (name.equals(correctname));{
  22. System.out.println("My creator!!");
  23. }
  24.  
  25. if (name.equals(null)); {
  26. System.out.println("Youre not my master!");
  27. }
  28.  
  29. System.out.println("What a nice name! How old are you?");
  30.  
  31. option3 = input.nextFloat();
  32. System.out.println("I am almost that old..");
  33. System.out.println("Do you want to know how old I am?");
  34.  
  35. String age = input.next();
  36. System.out.println("I am 4 years old");
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement