1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Basile [38]
3 years ago
12

Write a method named circleArea that accepts the radius of a circle as a parameter (as a real number) and returns the area of a

circle with that radius. For example, the call of area(2.0) should return 12.566370614359172. You may assume that the radius passed is a non-negative number.
Computers and Technology
1 answer:
lions [1.4K]3 years ago
6 0

Answer:

  public static double circleArea(double radius){

       double area = 3.142*Math.pow(radius,2);

       return area;

   }

Explanation:

Find the complete program in java that prompts the user to enter a value for radius, stores it in a variable, calls the method circleArea() and passes the value for the radius, then displays the area.

import java.util.Scanner;

public class CocaColaVendingTest {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Please enter the value for radius");

       double r = in.nextDouble();

       //Calling the method circleArea()

       double calcArea = circleArea(r);

       System.out.println("The Area is: "+calcArea);

   }

   public static double circleArea(double radius){

       double area = 3.142*Math.pow(radius,2);

       return area;

   }

}

You might be interested in
How to stay organized in an online school?
Nitella [24]
To stay organized on an online school is no cursing. and keep your files clean and organized
4 0
3 years ago
The New option is found in the ...............tab.​
morpeh [17]

in your notes books and in your vopy

3 0
3 years ago
Read 2 more answers
personalization allows customers to modify the standard offering, such as selecting a different home page to be displayed each t
shusha [124]
True, personalization is definitely part of this.
6 0
2 years ago
A technician is troubleshooting a Windows system in which an application works properly when the computer is booted in Safe Mode
sweet-ann [11.9K]

Answer:

yoooo nba BAD BAD

Explanation:

3 0
3 years ago
What is technology and how does it work?
Yuki888 [10]
Technology is what we use today to access internet and social media!!!
8 0
4 years ago
Other questions:
  • During the past decade ocean levels have been rising faster than in the past, an average of approximately 3.1 millimeters per ye
    14·1 answer
  • Vaporization is the process in which liquid is sufficiently cooled to change states of matter from a liquid to a vapor true or f
    8·1 answer
  • What is the very first thing a user usually must do to gain access to a secure computer?
    7·1 answer
  • Which of the following is used to encrypt web application data?
    11·1 answer
  • Use fuel with the _____________ rating recommended by your vehicle manufacturer. A ) Converter B) Emission C) Exhaust D) Octane
    9·2 answers
  • Sarah's Texas location has a server that is starting to give her trouble. It is needing to be restarted frequently and seems to
    15·1 answer
  • sparse(compact) Description: A sparse matrix is a 2D matrix that has many zeros. Assume that for storage efficiency someone has
    9·1 answer
  • Jack lost all the data he saved on his desktop because of a power outage while working on a presentation. On which of these comp
    15·2 answers
  • Select the correct answer.
    10·1 answer
  • Select one type of mobile phone connectivity you can use to stream videos on a smartphone
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!