-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDVD.java
More file actions
39 lines (34 loc) · 1016 Bytes
/
DVD.java
File metadata and controls
39 lines (34 loc) · 1016 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
public class DVD extends Playable {
private String director;
/**
* 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 DVD(double price, int numStock, double runtime, String title,String director) {
super(price, numStock, runtime, title);
setDirector(director);
}
@Override
public void play() {
play=!play;
if(play){
System.out.println("The movie is playing");
} else{
System.out.println("the movie is not playing");
}
}
@Override
public double rentalCost() {
return 1.20;
}
public String getDirector(){
return director;
}
public void setDirector(String director) {
this.director = director;
}
}