/** * Course title: Introduction to Programming Principles * Course number: CSCI 1301-03 * Instructor: Dr. Y. Daniel Liang * Description: Example 2.1, "Computing the Area of a Circle" * This class is for computing the area of a circle given the * radius. The radius is entered from the keyboard at the DOS * prompt. * Copyright: Copyright (c) 2000 * Company: Armstrong Atlantic State University * @author John F. Smith * @version 1.0, 11/30/2001 */ public class ComputeArea { /**Main method*/ public static void main(String[] args) { double radius; double area; // Prompt the user to enter radius System.out.print("Enter radius: "); radius = MyInput.readDouble(); // Compute area area = radius*radius*3.14159; // Display results System.out.println("The area for the circle of radius " + radius + " is " + area); } }