18 lines
469 B
Plaintext
18 lines
469 B
Plaintext
public class LongPlay extends Recording {
|
|
public LongPlay(String name, String artist, int year, int condition, double price) {
|
|
super(name, artist, year, condition, price);
|
|
}
|
|
|
|
@Override
|
|
public String getType() {
|
|
return "LP";
|
|
}
|
|
|
|
@Override
|
|
public double getPrice() {
|
|
double extraValuePerYear = 5;
|
|
double extraValue = (2024 - getYear()) * extraValuePerYear;
|
|
return super.getPrice() + extraValue;
|
|
}
|
|
}
|