Hello,
I am working through an online textbook for
Java. I am working on the following programming exercise:
If you have N eggs, then you have N/12 dozen eggs, with N%12 eggs left over. (This is essentially the definition of the / and % operators for integers.) Write a program that asks the user how many eggs she has and then tells the user how many dozen eggs she has and how many extra eggs are left over. (
http://math.hws.edu/javanotes/c2/exercises.html)
The proposed solution by the text uses a file written by the author. I was trying to complete it using java.util.scanner. Here is my code, but it keeps throwing an error. Which is why the author probably proposed a different solution. But, in short, I'd like to know why this code doesn't work.
Here is the error I get: java.util.Scanner[delimiters=\p{javaWhitespace}+][position=0][match valid=false][need input=false][source closed=false][skipped=false][group separator=\,][decimal separator=\.][positive prefix=][negative prefix=\Q-\E][positive suffix=][negative suffix=][NaN string=\QNaN\E][infinity string=\Q∞\E]
Thanks in advance!