Skip to content
Snippets Groups Projects
Commit 6e38a7e6 authored by Erkki Kaila's avatar Erkki Kaila
Browse files

doesn't seem to be working

parents
No related branches found
No related tags found
No related merge requests found
class Calculator {
private int result;
public Calculator() {
reset();
}
public void reset() {
this.result = 0;
}
public int getResult() {
return this.result;
}
public void add(int value) {
this.result += value;
}
public void subtract(int value) {
this.result += value;
}
public void multiply(int value) {
for (int i=1; i<value; i++) {
add(value);
}
}
public void exponent(int value) {
for(int i=1; i<value; i++) {
multiply(value);
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment