Repository navigation
Expand file tree
/
Copy pathTaskTen.java
More file actions
49 lines (37 loc) · 1.46 KB
/
Copy pathTaskTen.java
File metadata and controls
49 lines (37 loc) · 1.46 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
import java.util.Scanner;
public class TaskTen{
public static void main(String[] agrs){
Scanner userInput = new Scanner(System.in);
<<<<<<< HEAD
System.out.print("Enter weight: ");
int weight = userInput.nextInt();
if (weight < 0 || weight <= 2){
System.out.println("Ship fee = 2.5$");
}
else if (weight < 2 || weight <= 4){
System.out.println("Ship fee = 4.5$");
}
else if (weight < 4 || weight <= 10){
System.out.println("Ship fee = 7.5$");
}
else if (weight < 10 || weight <= 20){
System.out.println("Ship fee = 10.5$");
}
else if(weight > 20){
System.out.println("Package can not be Shipped");
}
}
}
=======
System.out.print("Enter amount of water in kilogram: ");
int inputKilogram = userInput.nextInt();
System.out.print("Enter initial Temperatures: ");
int initialTemperatures = userInput.nextInt();
System.out.print("Enter final Temperatures: ");
int finalTemperatures = userInput.nextInt();
int initialFinal = finalTemperatures - initialTemperatures;
int energyNeeded = inputKilogram * initialFinal * 4186;
System.out.print("energyNeeded: " + energyNeeded + "\n");
}
}
>>>>>>> 23f4b40 (Initial commit)