Guest User

Untitled

a guest
Apr 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class TriangleCalculator {
  3.  
  4. static Scanner sc = new Scanner(System.in) ;
  5. public static void main(String[] args)
  6. {
  7.  
  8. double base;
  9. double height;
  10.  
  11. System.out.print("Enter the Triangle's base: ");
  12. base = sc.nextDouble();
  13.  
  14. System.out.print("Enter the Triangle's height: ");
  15. height = sc.nextDouble();
  16.  
  17. double preArea = base * height;
  18.  
  19. double Area = preArea / 2;
  20.  
  21. System.out.println("The area of your Triangle is: " + Area );
  22. }
  23.  
  24.  
  25. }
Add Comment
Please, Sign In to add comment