Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class gettingback {
- public static void main(String[] args) {
- //declare variables
- Scanner input = new Scanner(System.in);
- float option1;//first user input option
- float option2;//second user input option
- float option3;//second user input option
- float option4;//second user input option
- float result;
- correctname = 'andre';
- float option5 =
- System.out.println("What is your name?");
- String name = input.next();
- if (name.equals(correctname));{
- System.out.println("My creator!!");
- }
- if (name.equals(null)); {
- System.out.println("Youre not my master!");
- }
- System.out.println("What a nice name! How old are you?");
- option3 = input.nextFloat();
- System.out.println("I am almost that old..");
- System.out.println("Do you want to know how old I am?");
- String age = input.next();
- System.out.println("I am 4 years old");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement