|
|
@ -7,12 +7,15 @@ public class MathProblems |
|
|
// zero for the divisor, an Exception will be thrown, both of which need to be caught |
|
|
// zero for the divisor, an Exception will be thrown, both of which need to be caught |
|
|
public void divide() |
|
|
public void divide() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
Scanner input = new Scanner(System.in); |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
System.out.print("Enter a: "); |
|
|
|
|
|
int a = input.nextInt(); |
|
|
|
|
|
System.out.print("Enter b: "); |
|
|
|
|
|
int b = input.nextInt(); |
|
|
} |
|
|
} |
|
|
catch( ) |
|
|
|
|
|
|
|
|
catch(InputMismatchException ime) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|