Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class TriangleCalculator {
- static Scanner sc = new Scanner(System.in) ;
- public static void main(String[] args)
- {
- double base;
- double height;
- System.out.print("Enter the Triangle's base: ");
- base = sc.nextDouble();
- System.out.print("Enter the Triangle's height: ");
- height = sc.nextDouble();
- double preArea = base * height;
- double Area = preArea / 2;
- System.out.println("The area of your Triangle is: " + Area );
- }
- }
Add Comment
Please, Sign In to add comment