// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class ComputerValue {
    public static int calculate(int priceAsNew, double numberYearsOld, boolean hasPapers) {
        return (int)(priceAsNew * Math.pow(0.75, 1 + numberYearsOld + (hasPapers ? 0 : 1)));
    }
    public static void main(String[] args) {
        System.out.println(calculate(11000, 0.5, true));
        System.out.println(calculate(11000, 0.5, false));
        System.out.println(calculate(11000, 0.0, true));
        System.out.println(calculate(11000, 1.5, true));
    }
}
