Open ShkarupyloMaksym opened 2 years ago
So you should check your code)
public static void main(String[] args) throws StringCalculator.MyException {
System.out.println(new StringCalculator().add("//[*][%]\n1*2%3"));
System.out.println(new StringCalculator().add("//[**][***]\n1**2***3"));
try {
System.out.println(new StringCalculator().add("1000,-999,-1001"));
}
catch (Exception e){
System.out.println(e.getMessage());
}
try {
System.out.println(new StringCalculator().add("1000,999,"));
}
catch (Exception e){
System.out.println(e.getMessage());
}
}
I have the cod with test, so your sollution doesn`t pass them: public static void main(String[] args) throws StringCalculator.MyException { System.out.println(new StringCalculator().add("//[][%]\n12%3")); System.out.println(new StringCalculator().add("//[][]\n123")); try { System.out.println(new StringCalculator().add("1000,-999,-1001")); } catch (Exception e){ System.out.println(e.getMessage()); }
The right sollution is: 6 6 Error Error But your is: 0 0 Error 1999