-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExerciseFive.java
More file actions
33 lines (20 loc) · 953 Bytes
/
Copy pathExerciseFive.java
File metadata and controls
33 lines (20 loc) · 953 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
package UnitTwo;
import java.util.Scanner;
public class ExerciseFive {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
System.out.println("Vacation type: Beach/Mountain - ");
String vacantionType = scanner.nextLine();
System.out.println("Enter your daily budget: ");
double dailyBudget = scanner.nextDouble();
boolean bulgaria = (vacantionType.equals("Beach") && dailyBudget < 50) || (vacantionType.equals("Mountain") && dailyBudget < 30);
boolean outsideBulgaria = (vacantionType.equals("Beach") && dailyBudget >= 50) || (vacantionType.equals("Mountain") && dailyBudget >= 30);
if (bulgaria) {
System.out.println("Bulgaria");
}else if(outsideBulgaria){
System.out.println("Outside Bulgaria");
}else {
System.out.println("No information about this type of vacation");
}
}
}