-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTempTest.java
More file actions
131 lines (109 loc) · 2.77 KB
/
Copy pathTempTest.java
File metadata and controls
131 lines (109 loc) · 2.77 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
public class TempTest {
private int temperature; //stores a given temperature
//constructor
public TempTest(int temp) {
temperature = temp;
}
//no-arg constructor
public TempTest() {
temperature = 0;
}
//accessor method
public int getTemperature() {
return temperature;
}
//mutator method
public void setTemperature(int temp) {
temperature = temp;
}
/**
The isEthylFreezing determines whether or not the temperature is
at or below the freezing point of ethyl alcohol.
@return ethylFreeze A boolean value that is true if the temperature is at or below freezing point.
*/
public boolean isEthylFreezing() {
boolean ethylFreeze;
if(temperature <= -173) {
ethylFreeze = true;
}
else {
ethylFreeze = false;
}
return ethylFreeze;
}
/**
The isEthylBoiling method determines whether or or not the temperature is
at or above the boiling point of ethyl alcohol.
@return ethylBoil A boolean value that is true if the temperature is at or above the boiling point.
*/
public boolean isEthylBoiling() {
boolean ethylBoil;
if(temperature > 172) {
ethylBoil = true;
}
else {
ethylBoil = false;
}
return ethylBoil;
}
/**
The isOxygenFreezing method determines whether or not the temperature is
at or below the freezing point of oxygen.
@return oxygenFreeze A boolean value that is true if the temperature is at or below the freezing point.
*/
public boolean isOxygenFreezing() {
boolean oxygenFreeze;
if(temperature < -362) {
oxygenFreeze = true;
}
else {
oxygenFreeze = false;
}
return oxygenFreeze;
}
/**
The isOxygenBoiling method determines whether or not the temperature is
at or above the boiling point of oxygen.
@return oxygenBoil A boolean value that is true if the temperature is at or above the boiling point.
*/
public boolean isOxygenBoiling() {
boolean oxygenBoil;
if(temperature > -306) {
oxygenBoil = true;
}
else {
oxygenBoil = false;
}
return oxygenBoil;
}
/**
The isWaterFreezing method determines whether or not the temperature is
at or below the freezing point of water.
@return waterFreeze A boolean value that is true if the temperature is at or below the freezing point
*/
public boolean isWaterFreezing() {
boolean waterFreeze;
if(temperature < 32) {
waterFreeze = true;
}
else {
waterFreeze = false;
}
return waterFreeze;
}
/**
The isWaterBoiling method determines whether or not the temperature is
at or above the freezing point of water.
@return waterBoil A boolean value that is true if the temperature is at or above the boiling point
*/
public boolean isWaterBoiling() {
boolean waterBoil;
if(temperature > 212) {
waterBoil = true;
}
else {
waterBoil = false;
}
return waterBoil;
}
}