/* * File: AreaOfTriangle.java * ------------------------- * This program prompts for the base and height * of a triangle and prints its area. * * Author: CS1MD3 */ import acm.program.*; public class AreaOfTriangle extends ConsoleProgram { public void run() { /* read the base */ double base = readDouble("Enter base: "); /* read the height */ double height = readDouble("Enter height: "); /* calculate and display the area */ double area = (base * height) / 2; println("Area = " + area); } }