-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayable.java
More file actions
63 lines (56 loc) · 1.47 KB
/
Playable.java
File metadata and controls
63 lines (56 loc) · 1.47 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
/**
* Class that implements products that can be playable.
*/
public abstract class Playable extends Product {
protected double runtime;
protected String title;
protected boolean play;
/**
* Create a new playable product.
* @param price The price of the product in pounds.
* @param numStock The amount of the product in stock.
* @param runtime The runtime of the product.
* @param title The title of the product.
*/
public Playable(double price, int numStock, double runtime, String title) {
super(price, numStock);
setRuntime(runtime);
setTitle(title);
}
/**
* Get the runtime of the product.
* @return The runtime of the product in minutes.
*/
public double getRuntime() {
return runtime;
}
/**
* Set the runtime of the product in minutes.
* @param runtime The runtime of the product in minutes.
*/
public void setRuntime(double runtime) {
this.runtime = runtime;
}
/**
* Get the title of the product.
* @return The title of the product.
*/
public String getTitle() {
return title;
}
/**
* Set the title of the product.
* @param title The title of the product.
*/
public void setTitle(String title) {
this.title = title;
}
/**
* Plays the playable media. We really don't know what
* to do here because media is not specified.
*/
public abstract void play ();
public double rentalCost(){
return 1.00;
}
}