Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5.  
  6. package polymoialtest;
  7.  
  8. /**
  9. *
  10. * @author flaarg
  11. */
  12. public class Main {
  13.  
  14. /**
  15. * @param args the command line arguments
  16. */
  17. public static void main(String[] args) {
  18. // TODO code application logic here
  19. Polynomial p = new Polynomial(2);
  20. Polynomial q = new Polynomial(3);
  21.  
  22. p.setCoef(3,0);
  23. p.setCoef(1,2);
  24.  
  25. q.setCoef(4,3);
  26. q.setCoef(2.5,2);
  27. q.setCoef(1,1);
  28. q.setCoef(7,0);
  29. System.out.println(p);
  30. System.out.println(q);
  31.  
  32. Polynomial r = p.plus(q);
  33. System.out.println(r);
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement