Commit 7b1a31e3 authored by Paul Esteve's avatar Paul Esteve
Browse files

Ecriture de Regime Legume et Viande

parent b8d5842b
package animals.regimes;
public class Legume extends Regime {
@Override
public double getCout(double qte){
return 1.2 * Math.log((qte +5 ) * 2 + 1);
}
@Override
public String toString(){
return super.toString() + "Végétarien";
}
}
package animals.regimes;
public abstract class Regime {
abstract public double getCout(double qte);
@Override
public String toString(){
return "Régime : ";
}
}
package animals.regimes;
public class Viande extends Regime {
@Override
public double getCout(double qte){
return Math.pow((qte* 10), 2) + 100;
}
@Override
public String toString(){
return super.toString() + "Carnivore";
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment