Skip to content
Snippets Groups Projects
Commit 92b61aa9 authored by RADELLAH Badr's avatar RADELLAH Badr
Browse files

First try

parent acb71132
No related branches found
No related tags found
No related merge requests found
package formula;
public class Square implements Formula {
private Formula formula;
public Square(Formula formula) {
this.formula = formula;
}
@Override
public String asString() {
return "(" + formula.asString() + "^2)";
}
@Override
public double asValue() {
return Math.pow(formula.asValue(), 2);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment