-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsoleapp.java
More file actions
75 lines (53 loc) · 1.54 KB
/
Copy pathConsoleapp.java
File metadata and controls
75 lines (53 loc) · 1.54 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import java.util.Scanner;
public class Consoleapp{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("Name: ");
String name = input.nextLine();
System.out.print("Age: ");
int age = input.nextInt();
System.out.print("Mood: ");
String mood = input.next();
System.out.print("Guess: ");
int guess = input.nextInt();
System.out.print("Want suggestion: ");
String suggestion = input.next();
System.out.println("Hello " + name + " Welcome to your personal assistant.");
if(age < 13) {
System.out.println("You're a young explorer!");
}
else if(age < 19){
System.out.println("Teen life is fun enjoy it!");
}
else if(age > 19 - 59){
System.out.println("Adulting can be challenging, stay strong!");
}
else {
System.out.println("Wisdom looks good on you!");
}
if(mood.equalsIgnoreCase("happy")){
System.out.println("keep smiling!");
}
else if(mood.equalsIgnoreCase("sad")){
System.out.println("Don't wory everything is gonna be alright");
}
else if(mood.equalsIgnoreCase("excited")) {
System.out.println("Awesome! Enjoy your energy");
}
else{
System.out.println("Rest well and recharge!");
}
if(guess == 1){
System.out.println("Wow! You guess it!");
}
else{
System.out.println("Try again next time!");
}
if(suggestion.equalsIgnoreCase("yes")){
System.out.println("Share your excitement by helping someone!");
}
else{
System.out.println("");
}
}
}