Advertisement
isabelgh

Untitled

Sep 8th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import java.lang.IllegalArgumentException;
  2.  
  3. public abstract class ErrorPascal implements Pascal {
  4.  
  5. public abstract void printPascal(int n);
  6. public abstract int binom(int n, int k);
  7.  
  8.  
  9. public static void termsPascal(int n)
  10. {
  11.  
  12. if(n <= 0 ){
  13. throw new IllegalArgumentException("Invalid values");
  14. }
  15. }
  16.  
  17. public static void termsBinom(int n, int k)
  18. {
  19. if(n < k || k < 0 || n < 0)
  20. {
  21. throw new IllegalArgumentException("Invalid values");
  22. }
  23.  
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement