Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Code cleanup

 
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was wondering if anybody could clean-up my code. I just implemented a two new lines and now one thing isn't working. I would probably be able to fix it if someone would clean up my code. By cleanup, I mean tell me what I don't need. There are lines I can get rid of but I don't know which ones because of the lengthiness of the code. Please help.
Thanks,
cc11rocks

Risk.java
 
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What "one thing" isn't working? Was it working before? What two new lines did you add? Why?

Finally, how is anyone supposed to know what code your program doesn't need?
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Greg Brannon wrote:What "one thing" isn't working? Was it working before? What two new lines did you add? Why?

Finally, how is anyone supposed to know what code your program doesn't need?


When you enter 0 or blank, it return system errors. With my previous code, it worked. The new lines i added were:

instead of:

I changed the code to this because it was not accepting anything greater than 999 due to automatic commas by NumberFormat. So either way, I have issues. Because I'm not relying on nos and yos, maybe I could get rid of some lines. If you could help me with any of the problems described, that would be great
Thanks,
cc11rocks
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

john price wrote:When you enter 0 or blank, it return system errors.


What kind of errors? TellTheDetails.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic