-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPartyFilter.java
More file actions
27 lines (22 loc) · 822 Bytes
/
PartyFilter.java
File metadata and controls
27 lines (22 loc) · 822 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
import java.util.Scanner;
public class PartyFilter {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Please Write your name :");
String a = sc.nextLine();
System.out.println("Please Write your Gender :");
String b = sc.nextLine();
System.out.println("Please Write your age :");
int c = sc.nextInt();
String d = "Male";
String e = "Female";
if (b.equals(d) && c > 18 ){
System.out.println("Welcome Mr." + a+" "+"To our Party!");
} else if (b.equals(e)&& c>18){
System.out.println("Welcome Ms." +a +" "+"To our Party!");
}
else{
System.out.print("Sorry Under 18 are not Allowed !");
}
}
}