Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Banner();
- Scanner SC=new Scanner(System.in);
- System.out.println("Enter the length of the three sides of a triangle: ");
- double a= SC.nextDouble();
- double b= SC.nextDouble();
- double c= SC.nextDouble();
- double s=a+b+c;
- System.out.println("The perimeter is: "+ s);
- double area=Math.sqrt((((s*(s-a))*(s-b))*(s-c)));
- System.out.print("Area of the triangle is: ");
- System.out.printf("%.3f", area);
- }
- public static void Banner(){
- System.out.println("Malachi Sor Homework 3.7");
- }
- }
Add Comment
Please, Sign In to add comment