Facebook
From Gamboge Meerkat, 1 Year ago, written in Plain Text.
This paste is a reply to Re: Re: Calculate radius n12 from Little Bee - view diff
Embed
Download Paste or View Raw
Hits: 143
  1. project IX;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class homework4 {
  6.     public static void radius_args(double radius) {
  7.         double s = Math.Pi*radius*radius;
  8.         double p = Math.Pi*2*radius;
  9.  
  10.     public static void main(String[] args) {
  11.         Scanner scanner = new Scanner(System.in);
  12.        
  13.         System.out.print("Enter the radius of the circle: ");
  14.         double radius = scanner.nextDouble();
  15.        
  16.         double area = calculateArea(radius);
  17.         double circumference = calculateCircumference(radius);
  18.        
  19.         System.out.println("The area of the circle is: " + area);
  20.         System.out.println("The circumference of the circle is: " + circumference);
  21.     }
  22.    
  23.     public static double calculateArea(double radius) {
  24.         return Math.PI * radius * radius;
  25.     }
  26.    
  27.     public static double calculateCircumference(double radius) {
  28.         return 2 * Math.PI * radius;
  29.     }
  30. }
  31.  

Replies to Re: Re: Re: Calculate radius n12 rss

Title Name Language When
Re: Re: Re: Re: Calculate radius n12 Insensitive Bat text 1 Year ago.