Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package spring18;
- import java.util.Scanner;
- public class Triangle {
- public static void main(String[] args) {
- double A,P;
- Scanner sc=new Scanner(System.in);
- System.out.println("Please Give Your base Size:");
- double b = sc.nextDouble();
- System.out.println("Please Give Your height Size:");
- double h = sc.nextDouble();
- A=0.5*(b*h);
- System.out.println("Area Formula");
- System.out.println(A);
- System.out.println("Perimeter Formula");
- System.out.println("Please Give Your sides Size:");
- double c = sc.nextDouble();
- P=(h+c+c);
- System.out.println(P);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement