Skip to content
Snippets Groups Projects
Commit 63389989 authored by Benjamin Basmaci's avatar Benjamin Basmaci
Browse files

translated exception messages to make output uniform

parent 8609e02c
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ int multiply(int a, int b) {return a * b;}
*/
int divide(int a, int b) {
if (b == 0) {
throw std::invalid_argument("Division durch 0!");
throw std::invalid_argument("Tried to divide by 0.");
}
return a / b;
}
......@@ -56,15 +56,15 @@ int evaluate(const std::string &s) {
stack.pop();
stack.push(iter->second(b, a));
} else {
throw std::invalid_argument("Ungueltige Sonderzeichen");
throw std::invalid_argument("Invalid character found.");
}
} else {
throw std::invalid_argument("Ungueltige Anzahl an Zahlen");
throw std::invalid_argument("Invalid number of digits.");
}
}
}
if (stack.size() > 1 || stack.size() == 0) {
throw std::invalid_argument("Ungueltige Eingabe");
throw std::invalid_argument("Invalid input.");
}
return stack.top();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment