-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlejandro.TXT
More file actions
54 lines (29 loc) · 1.29 KB
/
Alejandro.TXT
File metadata and controls
54 lines (29 loc) · 1.29 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* Alejandro have started learning java, he knows what you know about ifs and strings.
He has a large number of text emails, going trough all of them will take a lot of time.
to save time he will only read the emails that refer to him by name.
He wants to write a program that takes the email content as string and if his name "alejandro" exists in email content, then program prints "read this mail" else it will output "don't read".
for example:
a = "dear alejandro.....alot of text"
outputs: "read this mail"
a = "thunder blaz is the best drink in the galaxy..."
outputs: "don't read"
a = "subject : important project, alejandro we refer to you this ...."
outputs: "read this mail" */
import java.util.Scanner;
public class Alejandro_I {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s = new Scanner(System.in);
String a = s.nextLine();
//your code here
if(a.contains("dear alejandro.....alot of text")){
System.out.println("read this mail");
}
else if(a.contains("thunder blaz is the best drink in the galaxy...")){
System.out.println("don't read");
}
else if(a.contains("subject : important project, alejandro we refer to you this ....")){
System.out.println("read this mail");
}
}
}