-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathISpeakTxtmsg.java
More file actions
36 lines (31 loc) · 914 Bytes
/
Copy pathISpeakTxtmsg.java
File metadata and controls
36 lines (31 loc) · 914 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
35
36
package unitone.test;
import java.io.DataInputStream;
import java.io.IOException;
public class ISpeakTxtmsg {
@SuppressWarnings("deprecation")
public static void main(String[] args) throws IOException {
DataInputStream input = new DataInputStream(System.in);
String[] shortForm;
String userInput;
shortForm = new String[4];
shortForm[1]= "Canadian Computing Competition";
shortForm[2]="I'm happy";
shortForm[3]="talk to you later";
while (true) {
System.out.print("Enter phrase>");
userInput = input.readLine();
if (userInput.equalsIgnoreCase("CCC")) {
System.out.println(shortForm[1]);
}
else if (userInput.equalsIgnoreCase(":-)")) {
System.out.println(shortForm[2]);
}
else if (userInput.equalsIgnoreCase("TTYL")) {
System.out.println(shortForm[3]);
}
else {
System.out.println(userInput);
}
}
}
}