-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpaceAge.java
More file actions
45 lines (33 loc) · 731 Bytes
/
Copy pathSpaceAge.java
File metadata and controls
45 lines (33 loc) · 731 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class SpaceAge {
private double seconds;
SpaceAge(double seconds) {
this.seconds = seconds;
}
double getSeconds() {
return seconds;
}
double onEarth() {
return seconds / 31557600;
}
double onMercury() {
return onEarth() / 0.2408467;
}
double onVenus() {
return onEarth() / 0.61519726;
}
double onMars() {
return onEarth() / 1.8808158;
}
double onJupiter() {
return onEarth() / 11.862615;
}
double onSaturn() {
return onEarth() / 29.447498;
}
double onUranus() {
return onEarth() / 84.016846;
}
double onNeptune() {
return onEarth() / 164.79132;
}
}