0

No Zeros Java Exercice: solution right, Sololearn wrong?

The code gives the right answer yet sololearn takes it as wrong

22nd May 2022, 10:17 AM
Norberto Costa
Norberto Costa - avatar
10 odpowiedzi
+ 4
Norberto Costa Copy the statement (Еrror: division by zero) from description and paste in code. Don't write manually because there is some unknown character which we cannot see.
22nd May 2022, 10:48 AM
A͢J
A͢J - avatar
+ 2
Scanner scanner = new Scanner(System.in); try { int num1 = scanner.nextInt(); int num2 = scanner.nextInt(); /* 1. Еrror: division by zero 2. Error: wrong value type */ //your code goes here System.out.println(num1/num2); } catch(ArithmeticException ae) { System.out.println("Еrror: division by zero"); } catch(InputMismatchException ime){ System.out.println("Error: wrong value type"); } // Good Luck
22nd May 2022, 10:28 AM
SoloProg
SoloProg - avatar
+ 1
SoloProg your solution results but its 99% similar to mine. Do not understand.
22nd May 2022, 10:34 AM
Norberto Costa
Norberto Costa - avatar
+ 1
Not wasting time in understanding. Thsnks
22nd May 2022, 10:35 AM
Norberto Costa
Norberto Costa - avatar
+ 1
correct by probably the mistake is a one-letter bug in the code or a missing space.
22nd May 2022, 10:41 AM
SoloProg
SoloProg - avatar
+ 1
Norberto Costa There was a hidden typo in your code, don't know what it was. But when I deleted the catch statement "Error: division by zero", then copy /pasted that statement from the comment in the code, I got all passes
22nd May 2022, 11:00 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
i noticed that there is a difference n the shape of the second "E" i will do both of them E Е
22nd May 2022, 11:00 AM
SoloProg
SoloProg - avatar
+ 1
The same issue has come up before (see the link below). You should send a bug report (including screenshots) to info@sololearn.com. https://www.sololearn.com/discuss/3014097/?ref=app
22nd May 2022, 2:35 PM
Simon Sauter
Simon Sauter - avatar
- 1
Can you share your attempt with task description...!.
22nd May 2022, 10:25 AM
Jayakrishna 🇮🇳