write a program in java to calculate the area, perimeter and hypotenuse of a right angled triangle as per the user's choice.
Hypotenuse =
Area of triangle= 1/2*base*height
Perimeter = sum of all sides
( use switch case )
Answers
Answer:
hey here is ur answer
Explanation:
// Java Program to find Area of a Right Angled Triangle Example
package Area;
import java.util.Scanner;
public class AreaOfRightTriangle {
private static Scanner sc;
public static void main(String[] args) {
double width, height, c, Area, Perimeter;
sc = new Scanner(System.in);
System.out.println("\n Please Enter the Width of a Right Angled Triangle: ");
width = sc.nextDouble();
System.out.println("\n Please Enter the Height of a Right Angled Triangle: ");
height = sc.nextDouble();
Area = 0.5 * width * height;
c = Math.sqrt((width * width) + (height * height));
Perimeter = width + height + c;
System.out.format("\n The Area of a Right Angled Triangle = %.2f\n",Area);
System.out.format("\n The Other side of a Right Angled Triangle is: %.2f\n",c);
System.out.format("\n The Perimeter of a Right Angled Triangle = %.2f\n", Perimeter);
}
}
hope this helps u plz mark me as brainlist
program in java to calculate area is hypotenuse