Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public class SumOfTriangleSides {
  2. double resoult;
  3. int a=0;
  4. int b=1;
  5. int c=1;
  6. /*Triangle one = new Triangle();
  7. one.a=1;
  8. one.b=1;
  9. one.c=1;*/
  10.  
  11. public SumOfTriangleSides(String[] args){
  12. if (a<=0 || b<=0 || c<=0){
  13. System.out.println("Triangle can not have value of side equal zero or less.");
  14. }
  15. else if(a+b<=c || b+c<=a || c+a<=b){
  16. System.out.println("Triangle is impassible to make with those values. The sum of two sides must be bigger then the third side.");
  17. }
  18. else {
  19. resoult = a+b+c;
  20. System.out.println("Sum of triangle sides equal" + resoult);
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement