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

Replies to Re: Re: Calculate radius n12 rss

Title Name Language When
Re: Re: Re: Calculate radius n12 Gamboge Meerkat text 1 Year ago.