forked from Aswathykr/BlueJ.AliceAndBob
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
29 lines (21 loc) · 704 Bytes
/
Main.java
File metadata and controls
29 lines (21 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* Created by iyasuwatts on 10/17/17.
*/
import java.lang.String;
import java.util.Scanner;
public class Main {
public static void main(String[] args ){
/* write a program which prompts the user to ip their name
the program should greet names Alice and Bob */
//use control flow, cond, user ip, obj inst/dec, method invok
System.out.println("What is your name? ");
Scanner in = new Scanner(System.in);
String firstName = in.next();
if (firstName.equals("Alice") || firstName.equals("Bob"))
{
System.out.println("Nice to meet you!");
} else {
return;
}
}
}