Tweaked the error message a bit
This commit is contained in:
+5
-4
@@ -23,7 +23,7 @@ int BaseCalculator::calculate(const Operation& op)
|
||||
case OpType::Division:
|
||||
if (op.b == 0)
|
||||
{
|
||||
std::cerr << "Invalid operation requested! Resetting the accumulator to 0";
|
||||
std::cerr << "Invalid operation requested! Resetting the accumulator to 0\n";
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
@@ -31,12 +31,13 @@ int BaseCalculator::calculate(const Operation& op)
|
||||
break;
|
||||
|
||||
case OpType::Modulo:
|
||||
if (op.b == 0)
|
||||
if (op.b == 0)
|
||||
{
|
||||
std::cerr << "Invalid operation requested! Resetting the accumulator to 0";
|
||||
std::cerr << "Invalid operation requested! Resetting the accumulator to 0\n";
|
||||
result = 0;
|
||||
}
|
||||
result = op.a % op.b;
|
||||
else
|
||||
result = op.a % op.b;
|
||||
break;
|
||||
|
||||
case OpType::Special:
|
||||
|
||||
Reference in New Issue
Block a user