•  #### Computer Programming for Absolute Beginners #### Overview of this book

Preface Section 1: Introduction to Computer Programs and Computer Programming  Free Chapter
Chapter 1: Introduction to Computer Programs Chapter 2: Introduction to Programming Languages Chapter 3: Types of Applications Chapter 4: Software Projects and How We Organize Our Code Section 2: Constructs of a Programming Language Chapter 5: Sequence – The Basic Building Block of a Computer Program Chapter 6: Working with Data – Variables Chapter 7: Program Control Structures Chapter 8: Understanding Functions Chapter 9: When Things Go Wrong – Bugs and Exceptions  Chapter 11: Programming Tools and Methodologies Section 3: Best Practices for Writing High-Quality Code Chapter 12: Code Quality Other Books You May Enjoy Appendix A: How to Translate the Pseudocode into Real Code Appendix B: Dictionary # Handling exceptions

To understand how we can handle exceptions, we must first understand what the origins of a problem might be. It is only when we have understood this that we can insert measures to handle them correctly.

Let's return to our function that divides two values. Let's say this function takes two arguments, as it did in our previous example:

```function c(x, y)
result = x / y
end_function```

We should assume that this function does something more than just print this single line. We can mark it out with some comments, as follows:

```function c(x, y)
// The function does some things ere
result = x / y
// And even more things here
// It might even return a value
end_function```

We know that as this function divides two values, we might get an exception if `y` is given a value of `0`.

The first thing we should ask ourselves is if this is the...