You are on page 1of 1

If trusting someone is dangerous,then trusting no one is even more dangerous! import java.io.

*; class tri { int a,base,c,; float h,d; public void accept() throws IOException { InputStreamReader ir=new InputStreamReader(System.in); BufferedReader br=new BufferedReader(ir); System.out.println("\nenter 3 sidesj"); a=Integer.parseInt(br.readLine()); base=Integer.parseInt(br.readLine()); c=Integer.parseInt(br.readLine()); } public void calculate() { h=(a+base+c)/2; if(a+b>=c && b+c>=a && c+a>=b) { d=(s(s-a)(s-base)(s-c))^(1/2); } else { System.out.println("\n triangle condition violated"); } } public void display() { Sytem.out.println("the area of the triangle is "+d); } } class mine { public static void main(String[] ar) throws IOException { tri a=new tri(); a.accept(); a.calculate(); a.display(); } }

You might also like