1. A(n) ____ statement indicates the end of the catch block in the pseudo code.

A) final catch

B) finally

C) end catch

D) stop

 

2. Libraries are collections of classes that serve related purposes.

A) True

B) False

 

3. Write a method that will perform the a division operation (divide by) on the numbers passed to it in two variables (numerator, denominator) and outputs the results. Use a try-catch pair to output an error message if the illegal operation of divide by 0 occurs.

Answer:

int divide(int num, int denom)

{ double reuslt;

try{ return result=num/denom; }

catch(ArithmaticException) {//print Divide by zero}} 

 

4. A (n) ____ is one instance of a class.

A)  method

B)  object

C)  instantiation

D)  attribute

 

 

    • 11 years ago
    A+ Answers
    NOT RATED

    Purchase the answer to view it

    blurred-text