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
HELP 99PTS If Answered
Alborosie

You will have to do this as we are not you and we do not know local business/websites. Sorry we could not help.

3 0
3 years ago
Read 2 more answers
12.2 Sort an array in ascending order Write a program that gets a list of integers from input, and outputs the integers in ascen
notsponge [240]

Answer:

Explanation:

The following code is written in Java, it asks the user for the number of inputs that will be made and then the inputs. These inputs are placed into an array. Then the array is sorted and printed out to the terminal.

public static void sortArrayList() {

           ArrayList<Integer> sortedList = new ArrayList();

           Scanner input = new Scanner(System.in);

           System.out.println("Enter number of digits in Array");

           int numberOfInputs = input.nextInt();

           for (int i = 0; i < numberOfInputs; i++) {

                   System.out.println("Enter a number");

                   sortedList.add(input.nextInt());

           }

           int n = sortedList.size();

           for (int i = 0; i < n; i++)

               for (int j = 0; j < n-i-1; j++)

                   if (sortedList.get(j) > sortedList.get(j + 1))

                   {

                       // swap arr[j+1] and arr[j]

                       int temp = sortedList.get(j);

                       sortedList.set(j, sortedList.get(j + 1));

                       sortedList.set(j + 1, temp);

                   }

           for (int x : sortedList) {

               System.out.println(x);

           }

       }

7 0
2 years ago
describe how sodium ammonium chloride can be separated from a solid mixture of ammonium chloride and anhydrous calcium chloride​
kirill115 [55]

Answer:

There are way in separating mixtures of chlorides salts such as that of sodium chloride and ammonium chloride. It can be done by crystallization, filtration or sublimation. If we want to separate the mixture, we have to heat up to 330-350 degrees Celsius and collect the gas that will be produced.

5 0
3 years ago
What was the first e-commerce service?
docker41 [41]

The first e-commerce service would be A)Banking. Hope this helps.

8 0
3 years ago
E-commerce transactions that are executed using wireless mobile devices are known as
LUCKY_DIMON [66]

Answer:

Answer is Mobile commerce

4 0
2 years ago
Other questions:
  • You work for a large enterprise company that handles time-sensitive information. Your supervisor has asked that you set up a con
    8·1 answer
  • Write a function `has_more_zs` to determine which of two strings contains # more instances of the letter "z". It should take as
    9·1 answer
  • Buildings must be wired to comply with the latest National Electrical Code to ensure that, with adequate maintenance, the instal
    11·1 answer
  • To add and remove chart elements, you can use the add chart element button in the charts layout group on the ____ tab.
    6·1 answer
  • Please someone help me I hate python
    11·1 answer
  • The most popular way for hackers to take over hosts today is ________.
    15·2 answers
  • An IT technician has manually configured an IP address on a laptop for a new employee. Each time the employee tries to connect t
    10·1 answer
  • . Select the advantages of RAID-5 relative to other RAID schemes. (MAY SELECT MULTIPLE)
    7·1 answer
  • Your network has been having problems lately when users are participating in video conferences - the video and audio stutters ve
    13·1 answer
  • __________ is a broad class of software that is surreptitiously installed on a user's machine to intercept the interaction betwe
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!