• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I add error handling facilities to this code?

 
Diego Espinosa
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, i have this code that needs some error handling facilities (messages that warn user the data inputted is not valid that prvent crashing) added to it. I have no idea on how to do it and i accept any ideas. I'll post the code belllow. The code works by recieveing inputs through the console for student grades and calculating the total and the average. That works fine, but i need to include an error handling facility that doesnt allow the user to input letters, special characters or numbers outside the range 1-10. Can anyone help?

Program Name: The Edron Academy Grade Applet
NetBeans IDE 6.0
645 Words

 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google "regular expression", and "java regular expression"
 
Campbell Ritchie
Sheriff
Pie
Posts: 49367
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will find details of regular expressions in the Java Tutorials.

And welcome to the Ranch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic