0

was about to finish coding calculator but something happen and that is reached end of file while parsing

26th Jul 2021, 10:34 AM
Bura Thegreatho
8 Respuestas
+ 2
I'm sorry but this is an app for people who want to learn programming. If you're looking for mind readers you'll have to look somewhere else.
26th Jul 2021, 11:13 AM
Simon Sauter
Simon Sauter - avatar
+ 1
1.Java public class calculator{ public void add(int x,int y){ int sum =x+y; System.out.println(sum); } public void substract(int x, int y){ int difference = x-y; System.out.println(difference); } public void divide(int x, int y){ int quotient = x/y; System.out.println(quotient); } public void multiply(int x, int y){ int product =x*y; System.out.println(product); } public static void main(String[]args){ Calculator calculator = new Calculator(); calculator.add(4,2); calculator.substract(4,2); calculator.divide(4,2); calculator.multiply(4,2); }
26th Jul 2021, 12:59 PM
Bura Thegreatho
+ 1
What about now
26th Jul 2021, 12:59 PM
Bura Thegreatho
+ 1
Actually, I think I found the problem after all. You're missing one last closing curly brace "}" to close the one you open in the first line.
26th Jul 2021, 1:05 PM
Simon Sauter
Simon Sauter - avatar
+ 1
"end of file reached while parsing" means that your computer is looking for something that just doesn't come, usually a closing parenthesis or closing quotation mark.
26th Jul 2021, 1:08 PM
Simon Sauter
Simon Sauter - avatar
0
Am not looking mind reader
26th Jul 2021, 12:47 PM
Bura Thegreatho
0
1. You did not specify which programming language you are using. 2. You used a nonsense tag. 3. You haven't shown your code. (4. You haven't even asked a question.) So how is anyone supposed to help you unless they can read your mind?
26th Jul 2021, 12:51 PM
Simon Sauter
Simon Sauter - avatar
0
Now someone will be able to help you. Unfortunately I can't because I have very little experience in Java.
26th Jul 2021, 1:02 PM
Simon Sauter
Simon Sauter - avatar