-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathMain.java
More file actions
34 lines (27 loc) · 904 Bytes
/
Main.java
File metadata and controls
34 lines (27 loc) · 904 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
30
31
32
33
34
import java.util.Scanner;
/**
* Created by iyasuwatts on 10/17/17.
*/
//redone with instructor help
public class Main {
public static void main(String[] args ){
Scanner in = new Scanner(System.in);
String name = in.nextLine();
// String user1 = "Alice";
// String user2 = "Bob";
/* if (name.equals("Alice") || name.equals("Bob")){
System.out.println("Hey!!");
} else {
System.out.println("Try Again!");
}*/
testingNames( "Alice", name);
testingNames( "Bob", name);
}
//testingNames is your method
public static void testingNames(String username, String enteredname){
//this is basically saying if the entered name by the user is equal to the username: "Alice" or "Bob" then print
if (enteredname.equals(username)){
System.out.println("Hey!!!");
}
}
}