File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How can I add error handling facilities to this code?    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How can I add error handling facilities to this code?    " Watch "How can I add error handling facilities to this code?    " New topic
Author

How can I add error handling facilities to this code?

Diego Espinosa
Greenhorn

Joined: Mar 09, 2009
Posts: 1
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

Joined: Jun 26, 2002
Posts: 860
Google "regular expression", and "java regular expression"


http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37982
    
  22
You will find details of regular expressions in the Java Tutorials.

And welcome to the Ranch
 
wood burning stoves
 
subject: How can I add error handling facilities to this code?
 
Similar Threads
Netbeans and Ctrl + z (end of file)
accepting user input into into an array
concurrency error
Using maps
Confused with file read