StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Eror Handling in Programing Exercises - Assignment Example

Cite this document
Summary
One of the options it focuses on is the progressive testing for errors and exceptions as the program is being developed. This, according to Goodenough (1975), means that errors are only detected…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER93.3% of users find it useful
Eror Handling in Programing Exercises
Read Text Preview

Extract of sample "Eror Handling in Programing Exercises"

The paper "Error Handling in Programing Exercises" is a wonderful example of an assignment on logic and programming. This study explores two major options of error handling in programming exercises. One of the options it focuses on is the progressive testing for errors and exceptions as the program is being developed. This, according to Goodenough (1975), means that errors are only detected when they occur. The programmer detects errors during inputs and when retrieving the output data from the file in which they are stored.

The second option is to write a script for dynamic handling of errors and exceptions. The scripts ensure that the program does not experience the effect of the error but receives the report about the nature of any possible error.  Advantages and disadvantages of testing for error conditions as compared to using exception handling when performing input or output Advantages Testing enables the programmer to detect errors and exceptions during programming and to manage them before final implementation.

This is an assurance that the error is eliminated permanently. Disadvantages The challenge with testing for errors is that it can only test and manage known errors. Unknown errors, however, continue existing, unlike the exception handling that detects and prevents all possible errors in a block of program codes (Schilling, 1998). The programmer must have prior knowledge of the errors that he or she expects, hence, design the program in a manner to avoid the errors, or to use input data that does not violate the running of the program (Goodenough, 1975).

Testing of errors cannot manage unpredictable errors which may occur during the input and output. Secondly, the errors are only detected when they occur; unlike in exception handling where errors are prevented from occurring and are reported promptly. Why almost all programmers, in almost all cases, moved to use exception handling for input or output Exception handling is more convenient for most of the programmers first because it eliminates all program errors and reports them when detected.

Secondly, it relieves the programmer of the need to identify all possible errors as it is in error testing. Exceptional handling is detective and preventive, unlike error testing that is corrective. From the viewpoint of Kiniry (2006), exceptional handling is able to prevent errors that occur during input and output and enables the program used to have a new opportunity to provide correct input and avoid the effect of the errors. Thirdly, exception handling provides more information about the errors and exceptions, than does error testing.

Situations other than input or output that you might find exception handling useful Errors not only occur during the input and output stages. There are other situations in which exception handling becomes very useful. These include arithmetic operations. For example, when a number is divided by zero or when the arithmetic formula is incorrect, there occurs exception, which needs to be handled (Hof, Mössenböck and Pirkelbauer, 1997). The second situation is in the application of a logical statement.

For example, when a statement is written as follows: 1 = 0 2 + 2 = 10 True = False These statements are logically incorrect and may cause logical errors (Hutton and Wright, 2004). The third situation is when the name of the input file is not found. This is because either the file name specified in the program differs from the actual name of the input file used, or the route directory of the file is incorrect. Whether exception handling could be the preferred approach to use for those situations as well Exception handling is preferred in the three situations mentioned.

I arithmetic operations, it is possible that a programmer might have used a parameter with a zero value as a denominator in calculation. This can only be prevented from causing an error by the exception handler. In the logical statements, the errors have non-reversible effects and can only be prevented from occurring by the “try”, “catch” and “throw” constructs of exception handlers. The third situation is about the location and the name of the data file. According to Gabriel and Steele (2008), the exception handling mechanism is able to report the source of error during the execution and provide a timely opportunity for remedy.

Conclusion The two options for detecting and managing errors are both useful. However, it is easier and more reliable to work with exception handling because it is proactive and dynamic in the detection of unexpected errors. Inherently, a user does not have ideas about the errors to expect. With the error testing, he or she must have a list of all errors to manage. I exception handling, there is no need to worry as it manages all possible errors and exceptions. It is recommendable for all programmers to use exception handling as opposed to error testing method.

Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(Eror Handling in Programing Exercises Assignment, n.d.)
Eror Handling in Programing Exercises Assignment. https://studentshare.org/logic-programming/1850673-it110-1404b-03-introduction-to-programmingphase-3-discussion-board-initial-post-assignment
(Eror Handling in Programing Exercises Assignment)
Eror Handling in Programing Exercises Assignment. https://studentshare.org/logic-programming/1850673-it110-1404b-03-introduction-to-programmingphase-3-discussion-board-initial-post-assignment.
“Eror Handling in Programing Exercises Assignment”. https://studentshare.org/logic-programming/1850673-it110-1404b-03-introduction-to-programmingphase-3-discussion-board-initial-post-assignment.
  • Cited: 1 times

CHECK THESE SAMPLES OF Eror Handling in Programing Exercises

Java programming and written exercises

1.... Assume an Account object has data members - name, account number and balance, which can be defined as a string, an integer and a double type respectively.... The following program provides the partial Java code for the class Account declaration.... Please complete the accessor methods getName(), getBalance(), the mutator method setNameBalance(), and the toString() method which outputs the name, account number and balance. … 2....
3 Pages (750 words) Essay

Handling Discipline in Organizations

The author of this essay "handling Discipline in Organizations" focuses on the key principles that should underpin organizational practice in handling discipline.... he best practice in handling disciplinary matters within organizations is derived from the basis of following the dictum which is followed within the organization as well as the industries which are very closely related with this organization in essence.... handling discipline is one of the most significant premises in the modern times because it touches quite a few significant tangents, one such being the manner in which the organizations are playing their due role in instilling promulgation of its laws, rules, and policies – all of which are in line with the best practice regimes followed worldwide....
4 Pages (1000 words) Essay

Confidentiality in Case Handling

It is a fundamental precinct between the case manager and subject as it cultivates a mutual feeling of trust and confidence for Confidentiality in Case handling Confidentiality has always been a major issue of moral, legal and ethical concern pertaining to case handling between a client and a case manager.... The ethical principle is another tenet that refers to the guiding principles followed during a case handling process between the client and case manager (Kannenberg, 2003)....
1 Pages (250 words) Essay

Logical Programming Issues

The owner of the purchase system was able to identify the problem in the limitation of age of system users.... The solution was suggested to be automation.... The next step was analysis, to weigh the impact of the current system which could… The third step was Requirement Specification to decide on the input and the output data items such as the year of birth, the current year and the age....
1 Pages (250 words) Essay

The Impact of Exercise on Mental Health

Exercise is a physical activity that is well planned to improve the body in health and reenergize the body activities to be able to able to function to its optimal solution.... There are a few proven benefits of exercise which have been proven by medical professionals and this has… In this experts try to encourage the use of exercise to fight an addiction....
4 Pages (1000 words) Essay

Programming and culture in architecture

These details included the layout of different structures and their textures.... The sense of hearing revealed the different layouts from the direction of sound motion… For instance, the smell of vehicle exhaust fumes meant that there was a road or highway nearby.... The sense of touch especially in the public square and park gave details of texture....
1 Pages (250 words) Assignment

Conflict Handling Modes

This assignment "Conflict handling Modes" presents five conflict handling modes.... As aforementioned the reasons for conflict, the 'compromising' or 'collaborating' modes of conflict handling should be used.... Be sure to explain which conflict resolution skills and conflict handling mode you would use.... Then would use the collaborating conflict-handling mode to reach an agreement with the two employees and sought out a middle way that would benefit both the employees and would not hinder any productivity....
1 Pages (250 words) Assignment
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us