Tweaked the error message a bit
This commit is contained in:
1 parent
000629b937
commit
110a292529
1 file changed
+5
-4
+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