-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGoal.java
executable file
·60 lines (51 loc) · 953 Bytes
/
Goal.java
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
package alli;
public class Goal {
private int goalCalories;
private double goalDistance;
private int goalSteps;
public Goal()
{
goalCalories = 0;
goalDistance = 0;
goalSteps = 0;
}
public int getGoalCalories()
{
return goalCalories;
}
public void setGoalCalories(int cal)
{
goalCalories = cal;
}
public double getGoalDistance()
{
return goalDistance;
}
public void setGoalDistance(double dis)
{
goalDistance = dis;
}
public int getGoalSteps()
{
return goalSteps;
}
public void setGoalSteps(int steps)
{
goalSteps = steps;
}
public int calculateRemainingCalories(User user)
{
int temp = user.getCalories();
return goalCalories - temp;
}
public double calculateRemainingDistance(User user)
{
double temp = user.getDistance();
return goalDistance - temp;
}
public double calculateRemainingSteps(User user)
{
double temp = user.getSteps();
return goalSteps - temp;
}
}