# accepts the area of a square and will calculate its perimeter.

NareshChowdary
accepts the area of a square and will calculate its perimeter.
1 Answer(s)      6 years and 9 months ago
Posted in : Java Beginners

Develop a program that accepts the area of a square and will calculate its perimeter.

December 11, 2010 at 5:46 PM

Hi Friend,

Try the following code:

```import java.util.*;
import java.text.*;
class  PerimeterOfSquare{
public static void main(String[] args)
{
DecimalFormat df = new DecimalFormat("##.00");
Scanner input=new Scanner(System.in);
System.out.println("Enter Area of Square:");
double area=input.nextDouble();
double side=Math.sqrt(area);
System.out.println("Side of Square is: "+df.format(side));
double perimeter=4*side;
System.out.println("Perimeter of Square is: "+df.format(perimeter));

}
}
```

Thanks

accepts the area of a square and will calculate its perimeter.
accepts the area of a square and will calculate its perimeter.  Develop a program that accepts the area of a square and will calculate its perimeter... input=new Scanner(System.in); System.out.println("Enter Area of Square
Write a program to calculate area and perimeter of a circle
Write a program to calculate area and perimeter of a circle... example will teach you the method for preparing a program to calculate the area and perimeter of a circle. First of all name a class as "CircleArea"
How to calculate area of rectangle
How to Calculate Area of Rectangle       In this section we will learn how to calculate area... rectangle method which takes two parameters of type integer. To calculate the area
How to calculate area of triangle
; In this section we will learn how to calculate area of triangle. We... the area of triangle define the method triangle which will calculate the area... .style1 { margin-right: 0px; } How to Calculate
How to calculate area of Circle
How to Calculate Area of Circle   ... of calculating  the area of circle. In this program you will be taught each and every... the area of circle. After that it return the area of circle, return the doubles type
A Program to find area and perimeter of Rectangle
with the dot operator, invoking the method area(), which calculate the area and perimeter...A Program to find area and perimeter of Rectangle In this section we will explain you with the help of a program to find the area and perimeter of
program
program  accepts the area of a square and will calculate its perimeter.   Hello Friend, Visit Here Thanks
java code
java code   Develop a program that accepts the area of a square and will calculate its perimeter
Write a program for calculating area and perimeter of a rectangle
Write a program for calculating area and perimeter of a rectangle... this lesson, you will be able to write program for calculating the area and perimeter.... This is an instance of class method and is used to convert a string to an integer. Define the area
Text Area
Text Area  how to browse an image in text area instead of giving url of particular image
BlueJ (area of circle)
BlueJ (area of circle)  How does one write a program to calculate the area of a circle in BlueJ? Note that the user will have to provide the radius.   A simple program to calculate the area of a circle. radius provided
Square Elements of Two Dimensional Array
the two dimensional array program and its square. This session provide you... Square Elements of Two Dimensional Array   ...: We are going to display the square of two matrix. Firstly, we have to define
MySQL Area
; Run Procedure to calculate area: You can run MySQL stored procedure by using... MySQL Area       This example illustrates how to find the area of rectangle in MySQL. In this example
Square Root
Square Root  Hi, can any one please tell me the code to findout the square root of a given number with using built in function??? Thanks a lot in advance!! Regards: Akash
Method which returns area of circle - Java Beginners
of Circle : "+area); double perimeter = a.perimeterOfCircle(r...Method which returns area of circle  Need simple Java Method example that returns area of circle  Java Example CodeWith the help of given
calculate average
calculate average  Question 2 cont.d Test case c: home works/labs 10 9 9 9 10 10 9 9 10 10 9 9 10 test scores: 65 89 note, the program should work with different numbers of home works/labs
calculate average
calculate average   Design and write a java program to determine all three digit numbers such that the sum of the cubes of the digits is equal... and write a program and calculate your final average in this course. The details
calculate the time ..
calculate the time ..  [CODE] Elapsed Time Example <script type="text/javascript"> var startTime = null...="button" value="Calculate Difference" onclick="calculateTimeElapsed();" />
Area Tag in html5, Definition of <area> tag in HTML5.
Area Tag in html5, Definition of  <area> tag in html5 In this section we will discuss the use of <area> tag and about its implementation in the html document. The <area> tag is used for creating an area
Calculate sum and Average in java
Calculate sum and Average in java  How to calculate sum and average in java program?   Example:- import java.io.BufferedReader; import.... The given code accepts the numbers from the user using BufferedReader class. Then using
print square of any number
print square of any number  using c++ language, write aprogram to print the square of any number entered by the user
area of a circle - Java Beginners
area of a circle  Write a class circle which consists of functions getdata() and area(), and also write a main program to create a circle object and to find the area by calling the function area () in circle class and display
calculate size of array
calculate size of array  Is it possible to calculate the size of array using pointers in Java
calculate reward points.
calculate reward points.  How to calculate reward points in a multiplex automation system
bean area - SQL
bean area  how to print bean area in excel sheet from oracle forms
MySQL Area
MySQL Area  This example illustrates how to find the area of rectangle in MySQL. In this example we create a procedure to find the area of rectangle. In the query below we declare two integer type variable w and h with default
Code to calculate hair density
Code to calculate hair density  Hello, Would you please give me a code to calculate the hair density on scalp from image in java
calculate sum of individual digit
calculate sum of individual digit   How calculate product of first and last digit of indiviual numbers Like a=43278 4*8=32
Area Chart
Area Chart       In this section we are providing you an example to create a Area Chart. Description of Program For creating a Area Chart we use the object
square - Java Beginners
square  what is the java code to display the shape of "square"?  Hi friend, Code to display the shape of "square" import... SquareShape extends Frame { Shape square = new Rectangle2D.Double(100, 100,100