Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pentagon, where r is the length from the center of a pentagon to a vertex.

(Hint: Length of the side =2*length from the center to a vertex * sine(PI/5)

Area = (5 * Math.pow(side, 2)) / (4 * Math.tan(Math.PI /5));

For rounding to two decimal points uses String.format(“%.02f”,variablename))

**INPUT**
6.4 // Length from the center of a pentagon to a vertex
**OUTPUT**
97.39 // Area of pentagon

import java.io.*; import java.util.*; import java.lang.Math; public class temp { public static void main(String[] args) { double length , side , area; Scanner scan = new Scanner(System.in); System.out.println("Enter the Length from the center of a pentagon to a vertex: "); length = scan.nextDouble(); side = 2 * length * Math.sin(Math.PI/5); area = (5 * Math.pow(side,2)) / (4 * Math.tan(Math.PI/5)); System.out.println("Area of the pentagon: "+String.format("%.02f",area)); } }

**INPUT_1:**

Enter the Length from the center of a pentagon to a vertex:

6.4

**OUTPUT:**

Area of the pentagon: 97.39

**INPUT_2:**

Enter the Length from the center of a pentagon to a vertex:

5.9

**OUTPUT:**

Area of the pentagon: 82.77

**INPUT_3:**

Enter the Length from the center of a pentagon to a vertex:

7

**OUTPUT:**

Area of the pentagon: 116.50

**INPUT_4:**

Enter the Length from the center of a pentagon to a vertex:

5.2

**OUTPUT:**

Area of the pentagon: 64.29

**INPUT_5:**

Enter the Length from the center of a pentagon to a vertex:

10

**OUTPUT:**

Area of the pentagon: 237.76

**ILLUSTRATION**

**Morae Q!**

- Convert from binary number to decimal number.
- Swap two numbers by using division and multiplication.
- Compute foot and inches into centimetres.
- Concatenate Strings.
- Convert lowercase letters to uppercase letters.
- Compute the sum of all the digits of N.
- Compute the area of the pentagon.
- Get input using scanner.
- Find the distance between two points (x1,y1) and (x2,y2).
- Finding patterns in a file using frep and egrep .
- Detecting a cycle in a directed graph using Depth First Traversal.
- Topological ordering in a Graph.
- Storing graphs using adjacency list.
- Introduction to graph theory.
- Graph Adjacency Matrix pseudo code.
- Adjacency Matrix for storing graphs.
- Dijkstra’s shortest path algorithm .
- Breadth first search (BFS) Algorithm.
- Find the multiple of given number in the list of integers.
- Finding patterns in files using grep .