Ovn1/LongPlay
2024-04-07 15:28:51 +02:00

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;
}
}