-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLTE.java
41 lines (35 loc) · 899 Bytes
/
LTE.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
/** LTE sub-class of Cellular.
* @author Adam Bostwick
* @version 11/08/2019
*/
public class LTE extends Cellular
{
/** constants.*/
public static final double COST_FACTOR = 4;
/** constructor.
* @param nameIn input for name
* @param bandwidthIn input for bandwidth
* @param fixedCostIn input for fixedCost
* @param timeIn input for time
* @param dataLimitIn input for dataLimit
*/
public LTE(String nameIn, double bandwidthIn, double fixedCostIn,
double timeIn, double dataLimitIn)
{
super(nameIn, bandwidthIn, fixedCostIn, timeIn, dataLimitIn);
}
/** monthlyCost.
* @return true
*/
public double monthlyCost()
{
if (dataUsage() <= dataLimit)
{
return fixedCost;
}
else
{
return fixedCost + (dataUsage() - dataLimit) * LTE.COST_FACTOR * 2;
}
}
}