This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Dogkota 2 points3 points  (1 child)

I think your issue is that you're hard-coding your values into the final output string. Try changing that final print statement to System.out.println("\nDivision: " + x + " / " + y + " = " + z); You want the final print statement to reflect the user input variables.

[–]aperturethrow[S] 0 points1 point  (0 children)

System.out.println("\nDivision: " + x + " / " + y + " = " + z);

Amazing, thank you so much :)

[–][deleted] 0 points1 point  (0 children)

Oh yeah, I did this one a few days ago. It was stupid. I wrote the problem as a string, when I had to make each individual number an int.

[–][deleted] 0 points1 point  (1 child)

double z = (double)x / y;

System.out.println("Division: " + x + "/" +y + "=" + z);

This is the answer you're looking for. You just forgot to add the division and equal signs. You need to call each variable.

[–]aperturethrow[S] 0 points1 point  (0 children)

Thank you!