- Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathexpeditionProgram.java
More file actions
Latest commit
43 lines (36 loc) · 1.31 KB
/
Copy pathexpeditionProgram.java
File metadata and controls
43 lines (36 loc) · 1.31 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
importjava.util.Scanner;
publicclassexpeditionProgram {
publicstaticvoidmain(String[] args) {
Scannersc = newScanner(System.in);
intshipment, weight;
longprice = 0;
System.out.println("______________________________________");
System.out.println("JNX Expedition");
System.out.println("Program to determine the shipping costs\n\n");
System.out.println("List of Shipments Service :");
System.out.println("1. Domestic shipments");
System.out.println("2. International shipments\n");
System.out.print("Choose the shipments service (1 or 2) ! ");
shipment = sc.nextInt();
System.out.print("How heavy the item ? ");
weight = sc.nextInt();
if (shipment == 1) {
if (weight < 5) {
price = 0;
} elseif (weight >= 5 && weight <= 10) {
price = 165000;
} else {
price = 375000;
}
} elseif (shipment == 2) {
if (weight <= 2) {
price = 0;
} else {
price = 500000;
}
} else {
System.out.println("Invalid shipment service, please choose correctly!");
}
System.out.println("\nThe shipping costs is " + price);
}
}