Advertisement
shawonrog

Triangle

Jan 29th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1.  
  2. package spring18;
  3.  
  4. import java.util.Scanner;
  5.  
  6.  
  7. public class Triangle {
  8.  
  9. public static void main(String[] args) {
  10. double A,P;
  11. Scanner sc=new Scanner(System.in);
  12. System.out.println("Please Give Your base Size:");
  13. double b = sc.nextDouble();
  14. System.out.println("Please Give Your height Size:");
  15. double h = sc.nextDouble();
  16. A=0.5*(b*h);
  17. System.out.println("Area Formula");
  18. System.out.println(A);
  19. System.out.println("Perimeter Formula");
  20. System.out.println("Please Give Your sides Size:");
  21. double c = sc.nextDouble();
  22. P=(h+c+c);
  23. System.out.println(P);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement