Write a method that has the radius of the circle passed

Assignment Help Basic Computer Science
Reference no: EM13306354

Write a method that has the radius of the circle passed into it. It computes the area, and returns the area to the main method.
Also, write a line of code that might "call" the method from the main method. Example: x = theMethod(z);

This is what I have so far:
public class Circle {
public static double circleArea (double radius) {
double area = radius * radius * Math.PI ;
return area ;
}
// Main method
public static void main(String[ ] args) {
double radius = 0
try{

 

Reference no: EM13306354

Questions Cloud

Determine what is the adiabatic efficiency of the turbine : At the inlet the steam is at 1 MPa and 320 C, and leaves the turbine at 20 kPa. The work output of the turbine is measured to be 600 kJ/kg (of steam passing through the turbine).
What is the minimum nonzero thickness of the film : A piece of glass has a thin film of gasoline floating on it. A beam of light is shining perpendicular on the film. what is the minimum nonzero thickness of the film
Why timer can be source of repetition instead of looping : In java such as an event driven programming such as building a simple screen saver explain why the timer can be the source of repetition instead of looping and why is it better?
Determine humidity ratio-dew point and mass of dry air : An air-water vapor mixture at 0.1 MPa, 35 C and 70% relative humidity occupies a volume of 100 m^3 Determine the humidity ratio, the dew point, the mass of dry air in the volume and the mass of water vapor in the volume.
Write a method that has the radius of the circle passed : Write a method that has the radius of the circle passed into it. It computes the area, and returns the area to the main method.
What is the total kinetic energy of the disk : A solid disk (mass = 5 kg, R=0.6 m) is rolling across a table with a translational speed of 9 m/s. What is the total kinetic energy of the disk
Consider the reasons why firms may want to diversify and : Consider the reasons why firms may want to diversify and provide a critical assessment of the economic validity of their reasons for diversifying
Calculate the entropy change of the universe that occurs : The tank is insulated on the outside and the partition between the two sections is also an insulator. The partition can withstand a pressure differential across it of 400 kPa, before rupturing.
Determine what would be the total consolidation settlement : A normally consolidated clay layer in the field has a thickness of 3.2 m with an average effective stress of 70 kN/m^2. A laboratory consolidation test on the clay gave the following results: Pressure (kN/m^2)=100, 200 Void Ratio=0.905, 0.815

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write a select statement determines has any invalid values

Write a Select statement that determines whether the PaymentDate column of The Invoices table has any invalid values.

  How would you show an input mask for a serial number

In MS Access, how would you show an input mask for a serial number that had 5 letters followed by 7 numbers? No dashes or any other characters.

  When the jmpc field in the microinstruction is enabled

Assume that when the JMPC field in the microinstruction is enabled (set), MBR is ORed with NEXT_ADDRESS to determine the address of the next microinstruction to be executed

  How success or failure of restoration effort is estimated

Expalin why and how is success or failure of restoration effort estimated? Write down some significant considerations in creating monitoring plan to estimate restoration effort?

  Draw a circuit which implements a 1-to-2 decoder

Q1. Write the truth table for a 1-to-2 decoder. Draw a circuit which implements a 1-to-2 decoder using AND gates, OR gates and NOT gates only.

  Program that reads a file of computer data names computers

write a program that reads a file of computer data names computers.txt. creates an array of Computer objects.

  Convert hexadecimal number into unpacked bcd number

Convert any hexadecimal number from 00 to 63h placed in AX into its equivalent unpacked BCD number in AX. Multiply byte in register AL by byte in register BL. Place result in AX.

  Explain how to structure worksheet including titles

Explain how you will structure the worksheet, including the titles, column headings, and formulas to calculate the time it takes to make each size of cage.

  Write an iterative function power1 ,power2,power3

This problem considers several ways to compute xn for some n >= 0. (a) Write an iterative function power1 to compute xn for n >= 0.

  How many fragments are generated in link that has mtu

How many fragments are generated? What are values in the various fields in IP datagrams generated realted to fragmentaion?

  The mistake of forgetting the explicitly exit condition

When trying recursion for the first time, most new programmers make the mistake of forgetting the explicitly exit condition.

  In what ways do different types of seismic waves differ

In what ways do different types of seismic waves differ from waves on water.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd