-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbusProperty.java
More file actions
45 lines (37 loc) · 887 Bytes
/
busProperty.java
File metadata and controls
45 lines (37 loc) · 887 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
/**
* Write a description of class busProperty here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class busProperty extends Property
{
private int size;
public busProperty()
{
}
public busProperty(String name, String contactNum, int contract, int size)
{
super.(name, contactNum, contract);
this.size = size;
}
public int getSize()
{
return size;
}
public double calcInsurance()
{
double insurance = calcMonthRent() * 10/100.0;
return insurance;
}
public double calcMonthRent()
{
double rent = size * 250.0;
return rent;
}
public String toString()
{
String str = String.format("%s %-10d R%-10.2f R%-10.2f", super.toString(), size, calcInsurance(), calcMonthRent());
return str;
}
}