Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Given three sides of a triangle. Write the Program to
determine whether the triangle is :
1) Invalid
2) Right Angled
3) Isoscales
4) Equilateral
5) Not Special

An Isoscales right angled triangle should be taken as a
Right Angled Triangle

Answer Posted / ganesh bhat

I believe, this is more efficient one. solves all the cases.. comments please. Written in java

public static Map validateTriange(int a,int b,int c)
{
Map props = new HashMap();
boolean isValidTriangle;

int bigSide = a;
if(bigSide<b){bigSide = b;}
if(bigSide<c){bigSide = c;}

boolean isSpecial = false;

if((a+b+c-bigSide)>bigSide)
{
props.put("VALID","YES");
}
else
{
props.put("VALID","NO");
return props;
}

if(a == b||b==c||c == a)
{
props.put("ISOSCELES","YES");
isSpecial = true;
}

if(a == b && b == c)
{
props.put("EQUALATERAL","YES");
isSpecial = true;
}


if(((a*a+b*b+c*c)-bigSide*bigSide) == bigSide*bigSide)
{
props.put("RIGHT_ANGLED","YES");
isSpecial = true;
}

return props;
}

Is This Answer Correct ?    22 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain with examples any 2 features of OOPS.

1174


what is adodb??y it is used for connection of V.B and access??what is ado?dao?

2253


I am looking for selenium RC online Training in chennai. can any one tell me the best institute

2035


19. Given a system that is described with the following equation, X=A+(B.(A̅+C)+C)+A.B.(D̅+E̅) a) Simplify the equation using Boolean Algebra. b) Implement the original and then the simplified equation with a digital circuit. c) Implement the original and then the simplified equation in ladder logic.

1748


what are the differences between CONS, LIST, and APPEND

5399


in network security,how we identified threat?some one say we found threat according to it's signature,but how we get signature or pattern of the virus?

2100


we create a pf with 3 fields.2 is defined as keyfields.we lock it with alcobj command.how we find out whether the file is locked or not?is it dspfd??/

2087


What are events in smartforms?

2322


Given: coordinates of rectangle-> left bottom and right top points. the rectangles create a hole.Find the maximum area of the hole. eg. 4 rectangles create a hole in between. find its area.

2540


Do not use more than 3 nested IF. Use Evaluate statement in case of more IF required. Please give a detail explantion besides readability and clarity for Evaluate stmt.

2033


what is integration testing in real time applications?

2450


is it acceptable if we declare multiple exceptions in same overridden method.

2667


How to get the index of the clicked field in reports in ABAP?

1740


what is the work of 1tier,2tier,&ntier? Plz Explain it!

2521


how much fee for deccan soft institute .how to block seat for sandeep sir class reply soonnnn 

2319