Skip to content

added solution#293

Open
kvoytikh wants to merge 6 commits into
mate-academy:masterfrom
kvoytikh:kvoytikh-done-task
Open

added solution#293
kvoytikh wants to merge 6 commits into
mate-academy:masterfrom
kvoytikh:kvoytikh-done-task

Conversation

@kvoytikh
Copy link
Copy Markdown

added solution

added solution
added solution
return firstOperand - secondOperand;
case '/':
if (secondOperand == 0) {
throw new IllegalArgumentException("Divisor can't be zero");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw new ArithmeticException("Division by zero is not possible!");

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +9 to +21
class CalculatorTest {
private static final double DELTA = 0.0001;
private static Calculator calculator;

@BeforeAll
static void setUp() {
calculator = new Calculator();
}

@Test
void calculate_additionTwoPositiveOperands_Ok() {
double expected = 30.0;
double actual = calculator.calculate(20.0, 10.0, '+');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

объяви 1 раз expected and actual и используй их во всех методах

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +17 to +18
case '^':
return Math.pow(firstOperand, secondOperand);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

добавь еще 1 метод firstOperand = 0, secondOperand = -2

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

added solution
added solution
added solution
added solution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants