Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SumOfTriangleSides {
- double resoult;
- int a=0;
- int b=1;
- int c=1;
- /*Triangle one = new Triangle();
- one.a=1;
- one.b=1;
- one.c=1;*/
- public SumOfTriangleSides(String[] args){
- if (a<=0 || b<=0 || c<=0){
- System.out.println("Triangle can not have value of side equal zero or less.");
- }
- else if(a+b<=c || b+c<=a || c+a<=b){
- System.out.println("Triangle is impassible to make with those values. The sum of two sides must be bigger then the third side.");
- }
- else {
- resoult = a+b+c;
- System.out.println("Sum of triangle sides equal" + resoult);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement