// Path: Chapter9/PP1/NegativeNumberException.java
// public class NegativeNumberException extends Exception
// {
// // Default Constructor
//     public NegativeNumberException()
//     {
//         super("N must be positive.");
//     }
// // 1 arg Constructor (string)
//     public NegativeNumberException(String message)
//     {
//         super(message);
//     }
// }


import tomas.ochoa.NegativeNumberException;
import java.util.Scanner;

            System.out.println(e.getMessage());
            System.out.println("Program terminated");
            System.exit(-2);
        }
        // Call calc avg to calc N avg
        calcAverage(n);
    }



    public static double calcAverage(int n)
    {
        double avg = 0.0;
        double total = 0.0;
        double input = 0;
        Scanner keyboard = new Scanner(System.in);
        boolean done;

        //For loop to get an int for n times
        for(int i = 0;i<n;i++)
        {
            done = false;
            //While loop to continue until don
            while (!done)
            {
                // Get input
                System.out.print("Enter integer: ");
                input = keyboard.nextDouble();

                //Try block

// Path: Chapter9/PP1/NegativeNumberException.java
// public class NegativeNumberException extends Exception
// {
// // Default Constructor
//     public NegativeNumberException()
//     {
//         super("N must be positive.");
//     }
// // 1 arg Constructor (string)
//     public NegativeNumberException(String message)
//     {
//         super(message);
//     }
// }


// Path: Chapter9/PP1/Main.java
import tomas.ochoa.NegativeNumberException;
import java.util.Scanner;

            System.out.println(e.getMessage());
            System.out.println("Program terminated");
            System.exit(-2);
        }
        // Call calc avg to calc N avg
        calcAverage(n);
    }



    public static double calcAverage(int n)
    {
        double avg = 0.0;
        double total = 0.0;
        double input = 0;
        Scanner keyboard = new Scanner(System.in);
        boolean done;

        //For loop to get an int for n times
        for(int i = 0;i<n;i++)
        {
            done = false;
            //While loop to continue until don
            while (!done)
            {
                // Get input
                System.out.print("Enter integer: ");
                input = keyboard.nextDouble();

                //Try block

                try
