You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
642 B

7 years ago
  1. import java.util.*;
  2. public class MathProblems
  3. {
  4. // Implement this method, which prompts the user for a and b, then divides a by b
  5. // and then calculates a % b. If the user enters an invalid type of input, or a
  6. // zero for the divisor, an Exception will be thrown, both of which need to be caught
  7. public void divide()
  8. {
  9. try
  10. {
  11. }
  12. catch( )
  13. {
  14. }
  15. catch( )
  16. {
  17. }
  18. }
  19. public static void main( String[] args )
  20. {
  21. // Test it here in main, when ready
  22. MathFunctions functions = new MathFunctions();
  23. functions.divide();
  24. }
  25. }