The following program is meant to calcuate simple interest given the formula i = p\*r\*t, given the user input and putting that into its own method (Must) , however, when running it i get the error "Unhandelled exception type IOException..." I tried implementing a try catch block previously but it resulted into more errors

```
import java.io.*;

public class cInterest {

    public static void main(String[] args) throws IOException {

    }

    public static double balance(double principal, double rate, double years) {

        double amount = 0;

        String input;
        BufferedReader myInput = new BufferedReader(new InputStreamReader(
                System.in));

        System.out.print("How much would you like to take out? ");
        input = myInput.readLine();
        principal = Double.parseDouble(input);

        System.out.print("Enter the interest rate: ");
        input = myInput.readLine();
        rate = Double.parseDouble(input);

        for (int i = 1; i < years; i++) {
            amount = principal * rate * years;
            amount += principal;
        }
        return amount; // - principal;

    }
}

```