diff --git a/src/makeRobotAccountant.js b/src/makeRobotAccountant.js index 38b9758a..b2f107ad 100644 --- a/src/makeRobotAccountant.js +++ b/src/makeRobotAccountant.js @@ -6,7 +6,20 @@ */ function makeRobotAccountant() { - // write code here + let counter = 0; + + return function getSum(num1) { + return function(num2) { + counter++; + + if (counter % 2 === 0 && counter > 3) { + return 'Bzzz... Error!'; + } + + return num1 + num2; + }; + }; } module.exports = makeRobotAccountant; +