- You should work on this project in your own repository.
- Click the
fork
button in the top right corner to create a copy of this repository on your github account. - You can go through the GitHub forking tutorial if you need additional practice with this.
- Write a program which prompts the user to input his/her name.
- The program should greet users whose names are 'Alice' and 'Bob'.
- To establish familiarity with
- Control Flow
- Conditionals
- User input
- Object instantation/declaration
- Method invokation
- Understand how to get input string from user
- Create conditional to check against Alice and Bob
- Print greeting to screen if Alice or Bob are true
- Print "You are neither Alice nor Bob."
- When finished, make certain your last commit message is "finished"
Standard input and standard output are important concepts in Java programming.
Standard input is a way for a program to receive input from the user or another program. In Java, standard input is represented by the System.in
object. This object can be used with a Scanner object to read input from the user or another program. For example, the following code reads a line of text from the user and stores it in a variable:
Scanner scanner = new Scanner(System.in);
System.out.print("Enter your name: ");
String name = scanner.nextLine();
Standard output is a way for a program to output information to the user or another program. In Java, standard output is represented by the System.out
object. This object can be used with the println() method to output text to the console. For example, the following code outputs a greeting to the user:
System.out.println("Hello, " + name + "!");
Standard input and standard output are important concepts in Java programming that allow programs to interact with the user and other programs.
When finished, make certain your last commit message is "finished"