Category: 7. Geometrical Calculations
-
Program to calculate area and circumference of circle
In this tutorial we will see how to calculate area and circumference of circle in Java. There are two ways to do this: 1) With user interaction: Program will prompt user to enter the radius of the circle2) Without user interaction: The radius value would be specified in the program itself. Program 1: Output: Program 2:…
-
Program to calculate area of Triangle
Here we will see how to calculate area of triangle. We will see two following programs to do this:1) Program 1: Prompt user for base-width and height of triangle.2) Program 2: No user interaction: Width and height are specified in the program itself. Program 1: Output: Program 2: Output:
-
Program to calculate area of Square
In this tutorial we will learn how to calculate area of Square. Following are the two ways to do it: 1) Program 1: Prompting user for entering the side of the square2) Program 2: Side of the square is specified in the program’ s source code. Program 1: Output: Program 2: Output:
-
Program to Calculate Area of Rectangle
In this tutorial we will see how to calculate Area of Rectangle. Program 1:User would provide the length and width values during execution of the program and the area would be calculated based on the provided values. Output: Program 2:In the above program, user would be asked to provide the length and width values. If you…