Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Java get the area of circle
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Doshyo
Java get the area of circle
1 Answer(s)      6 years and 10 months ago
Posted in : Java Beginners


Find the area of Circle in Java.


Advertisement
View Answers

April 16, 2008 at 7:24 PM


Hi,

import java.io.*;

public class CircleArea{
public static void main(String[] args){
try{
BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Radius of Circle : ");
int r = Integer.parseInt(br1.readLine());
double area = java.lang.Math.PI*r*r;
System.out.println("Area of Circle : "+area);
double perimeter =2*java.lang.Math.PI*r ;
System.out.println("Perimeter of Circle : "+perimeter);
}
catch(Exception e){
System.out.println("Error : "+e);
}
}
}

------------------------


Related Tutorials/Questions & Answers:
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
Method which returns area of circle - Java Beginners
Method which returns area of circle  Need simple Java Method example that returns area of circle  Java Example CodeWith the help of given Java code you can return the area of a circle and give the radius
Advertisements
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
Java Circle to Circle collision detection
Java Circle to Circle collision detection  Java Circle to Circle collision detection
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
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"
Circle question - Java Beginners
void calculate(Circle c){ double r=c.getRadius(); double area=pi*r*r; double...Circle question  Hey You helped me with one this question already... that uses Circle class you created in the previous assignment. ? The program
How do I handle the reaction of a circle and a semi-circle colliding in java?
How do I handle the reaction of a circle and a semi-circle colliding in java?  How do I handle the reaction of a circle and a semi-circle colliding in java
circle
circle  Program to test whether a given point lies inside a circle... of the circle : "); double r = input.nextDouble... of circle : "); double x1 = input.nextDouble(); System.out.print
Java GUI code- creating a circle
Java GUI code- creating a circle  My assignment is to write a program that prompts the user to enter the center and a point on the circle, which is (x,y)(x2,y2). The program should then output the circle's radius, circumference
How to Create Circle In Java
How to Create Circle In Java       Introduction: This is a simple program of java awt. In this section, you will learn how to create Circle Diagram. The java circle is the most
Java gui program for drawing rectangle and circle
Java gui program for drawing rectangle and circle   how to write java gui program for drawing rectangle and circle? there shoud be circle.... and the program must also show message dialog "this is a red circle" when click
Creating circle inside a circle
Creating circle inside a circle  hi can any one give code for following output by awt/swing creating circle inside a circle ,outside cirlce and intersect a circle
Java method final parameter
. In the example the radius parameter for calculating the area of circle have been...*radius*radius; System.out.println("Area of Circle= "+area... Java method final parameter   
How to Create Text Area In Java
How to Create Text Area In Java       In this section, you will learn how to create Text Area in Java... and a text area is also created on the panel by using JTextArea class
By using Applet display a circle in a rectangle
By using Applet display a circle in a rectangle  Write a java applet to display a circle in a rectangle
Generate area for map from backing bean - Java Server Faces Questions
Generate area for map from backing bean  I need to populate the map in my page, and the coordinates should come from the backing bean.. How could I do
How to draw a circle bucket, draw a circle bucket, circle bucket
How to draw a circle bucket       This example has a simple way to learn easily to make a circle shape... style: Go to Layer menu > Layer style > Bevel and emboss. Draw Circle
setting RGB for a circle
setting RGB for a circle  how can i change the color of the circle(not through filling it) and i want to use RGB (not regular colors such as black or red..) i should include RGB numbers (for example 240, 150, 19) but i am
Text Area
Text Area  how to browse an image in text area instead of giving url of particular image
get absolute time java
get absolute time java  How to get absolute time in java
How to design a circle logo, design a circle logo, a circle logo
How to design a circle logo     ... will learn here a simple circle logo, I have not used tough steps so it is easy... a "Circle thin frame" by the Custom shape tool (U key) with any
java get file permission
java get file permission  How to check the get file permission in Java
How to get Java SDK
How to get Java SDK  Hi, I have purchased a new computer and installed windows 7. Now I have to get the Java SDK and install on my computer for developing and testing Java programs. So, can anyone tell me How to get Java SDK
Area Tag in html5, Definition of <area> tag in HTML5.
Area Tag in html5, Definition of  <area> tag in html5... in the html document. The <area> tag is used for creating an area...: The syntax for the <area> tag is as follows: <area
java script to replace words starting and ending with tild(~) symbol in a text area with the word highlighted yellow.
java script to replace words starting and ending with tild(~) symbol in a text area with the word highlighted yellow.  Hi, I have an issue with highlighting text in a text area. I am designing a page to send email. currently
get median in java
get median in java  How to get the median value in Java from the given list.   import java.util.*; class FindMedian { public static int findMedian(int array[]) { int length=array.length; int[] sort = new int[length
Java get System Locale
Java get System Locale       In this section, you will learn how to obtain the locale. We are providing you an example which will obtain the locale of the system
How to calculate area of triangle
Area of Triangle       In this section we will learn how to calculate area of triangle. We are going to use area of triangle is half of the area of the parallelogram. Here
programming - Java Beginners
Java get the area of circle  Find the area of Circle in Java. ...; System.out.println("Area of Circle : "+area); double perimeter =2...(System.in)); System.out.println("Enter Radius of Circle : "); int r
how to get this xml syntx in java??????
how to get this xml syntx in java??????   how to get this xml syntx in java?????? < comp xlink:type="new" xlink:actuate="onload"/>
 

 

 

DMCA.com