This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I think what you have missed is how the Scanner works. The method nextFloat() won't lookup the next suitable float, it will look at the next token and see if it fits into a float. Same with hasNextFloat().
Actually hasNextFloat is useful if there are problems.But why are you using floats in the first place? You don't usually use floats for retailer codes. If the retailer is ABC123, that's a String, and you can pick it up with the next() method in your Scanner.
You won't get much output from printf if you don't have any % tags.
Joined: Sep 22, 2011
AB123 is a combination of letters and digits. I thought if it's combined, it's float since we've never used this before.
Thank You ALL so much! this forum really does help me. Congratulations for creating this forum!!
Joined: Oct 13, 2005
You're welcome, and thank you for changing your name.