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]
2 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]2 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
The small flash memory used in<br>protable device like Laptop<br><br>​
xxMikexx [17]

Answer: flash drive

Explanation:

Flash drives are refered to as small, portable storage devices which makes use of a USB interface in order to be connected to a laptop.

Flash cards are removable and rewritable. They are mainly used to store data. Flash cards can be found in computers, laptops, digital cameras etc.

4 0
3 years ago
A ______________ is a document created when planning resource management to help promote teamwork and clarify team communication
Ivahew [28]

Answer: team contract

Explanation:

A team contract is a document created when planning resource management to help promote teamwork and clarify team communications. This document helps to sort out which are the most important matters and needs more importance to be given.

It help to guide and give proper management of resources for a project or an organization. It also ensures that the members of the team abide by its set of rules defined within the team contract.

5 0
2 years ago
Which of these are examples of a bug?
nadya68 [22]
The answer is b and c
7 0
3 years ago
Which operating system became obsolete with the arrival of a more advanced graphical user interfaces
12345 [234]
The answer is Ms Dos
6 0
3 years ago
Are self driving cars essential for the future of transportation
azamat
Yes, I think so at least because what about those who can't physically drive? They would want the experience of being in the driver's seat.
6 0
3 years ago
Other questions:
  • Which of the following statements is true of a database? a. It is a collection of unstructured data. b. It is accessed primarily
    14·1 answer
  • Which of the following loop conditions will read all the data in the file assuming that each line in the file contains two integ
    5·1 answer
  • Write a Java program that prompts the user to enter a sequence of non-negative numbers (0 or more), storing them in an ArrayList
    5·1 answer
  • What is the Most popular game out today?
    6·2 answers
  • What command is most effective at identifying different types of files?
    6·1 answer
  • Explain how SEO impacts the way you should interpret search engine results ???
    6·1 answer
  • Question 1 of 10 Chase lives in Oregon but works for a company that is located in Florida. What business trend is this an exampl
    11·2 answers
  • Adding Page Numbers in the Footer
    15·1 answer
  • Complete the function favoriteFlower(). Note that the program will not run as is because the function is incomplete. The purpose
    15·1 answer
  • True or False? The background color block should be inserted after all the images are added.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!