0
No Zeros Java Exercice: solution right, Sololearn wrong?
The code gives the right answer yet sololearn takes it as wrong
9 Réponses
+ 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.
+ 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
+ 1
SoloProg your solution results but its 99% similar to mine. Do not understand.
+ 1
Not wasting time in understanding. Thsnks
+ 1
correct by probably the mistake is a one-letter bug in the code or a missing space.
+ 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
+ 1
i noticed that there is a difference n the shape of the second "E" i will do both of them
E Е
+ 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
- 1
Can you share your attempt with task description...!.