<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import java.io.*;

/** Lab 13. CS1110 Exception handling */
public class Lab13 {
    /** = a buffered reader attached to the keyboard. If you store this value
      *   in a variable kbd (say), then
      * 
      *      kbd.readLine()
      * 
      *   will prompt the reader to type a line by putting in the interactions pane
      *   a field into which to type and will then yield the string of characters
      *   the user typed in.
      */    
    public static BufferedReader getKeyboard()  {
        // Create and store in kbd a link to the keyboard
        return new BufferedReader(new InputStreamReader(System.in));
    }
    
    
    
    /** Prompt the reader to type a line into the interactions pane and
      * return the line that the user types. */
    public static String readKeyboardLine() throws IOException {
        BufferedReader kyboard= getKeyboard();
        String line= kyboard.readLine();
        return line;
    }
    
    /** Prompt the reader to type an integer (an int) into the interactions pane
      * and return the integer that they type. If the user types something that
      * is not an int, then issue a message (System.out.println(...) and prompt
      * again.
      */
    public static int readKeyboardInt() throws IOException {
        BufferedReader kyboard= getKeyboard();
        return 0;
    }
    
    /** = b**c.
          Precondition: c ³ 0
        */
    public static double exp(double b, int c) {
        if (c == 0)
            return 1;
        // c &gt; 0
        if (c%2 == 0)
            return exp(b*b, c / 2);
        // c is odd and &gt; 0
        return b * exp(b, c-1);
    }
    
    /** = the value i such that x**i &lt;= .00000001 but x**(i-1) is not.
          Throw MyException if x &lt;= 0 or 1 &lt;= x. 
       */
    public static int approach(double x) {
        int i= 1;
        return i;
        
    }
}
</pre></body></html>