Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Management Expert

Please help with the following call using a testcircle.java ? May have to change the original...lost here

a. a class named Circle with fields named radius, diameter, and area. Including a constructor that sets the radius to 1 and calculates the other two values. Also including methods named setRadius()and getRadius(). The setRadius() method not only sets the radius but also calculates the other two values. (The diameter of a circle is twice the radius, and the area of a circle is pi multiplied by the square of the radius. Using the Math class PI constant for this calculation.) class as Circle.java.

b. a class named TestCircle whose main() method declares several Circle objects. Using the setRadius() method, assign one Circle a small radius value, and assign another a larger radius value. Do not assign a value to the radius of the third circle; instead, retain the value assigned at construction. Displaying all the values for all the Circle objects. Save the application as TestCircle.java.

public class Circle {

public static void main(String[] args);{

 public double radius;

 public double diameter;

 public double area;

 public double circum;

 public Circle() {

  radius = 1.0; 

diameter = 2*radius;

area = Math.PI * radius * radius;

circum = 2 * Math.PI * radius;

 }

 public Circle(double r) {

  radius = r;

diameter = 2*radius;

area = Math.PI * radius * radius;

circum = 2 * Math.PI * radius;

 }

 public void setRadius(double r) {

  radius = r;

diameter = 2*radius;

area = Math.PI * radius * radius;

circum = 2 * Math.PI * radius;

 }

 public double getRadius() {

  return radius;

 }

 public double getArea() {

  return area;

 }

  public double getDiameter() {

  return diameter;

 }

 public double getCircumference() {

  return circum;

 }

 public String toString(){

return "Radius = " + radius +

"nArea = " + area + 

"nCircumference = " + circum;

}

}

Business Management, Management Studies

  • Category:- Business Management
  • Reference No.:- M92708720
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Business Management

What is the role of arp and how does it cause a security

What is the role of ARP and how does it cause a security concern? What is the different between global and private IP addresses? How does using NAT change a private IP address into a global IP address, and why is this so ...

Are communication apps like slack replacing face to face

Are communication apps like Slack replacing face to face meetings between supervisors and employee's? If so, why?

Summarizing obsolete inventoryusing idea for this exercise

Summarizing Obsolete Inventory Using IDEA. For this exercise, your client, Bright IDEAs Inc., has provided you with a listing of inventory as of year end. To analyze the amount of obsolete inventory, as reported by the c ...

Case question the aggressive ad agency describe the type of

Case question The Aggressive Ad Agency, describe the type of business information that the agency is offering to Microsoft, and why it could be unethical for Mr. LeBow to accept the offer. What do you believe Mr. LeBow s ...

Using the automobile industryand identify porters five

Using the automobile industry,and identify Porter's five forces and describe how each applies to the industry. Give as much detail as possible and support your answer.

Suppose that a firm had a production function given by

Suppose that a firm had a production function given by: q=2L0.4K0.8. The rental rate for the firm is $20 and the wage is $15. Solve the optimization condition for K and then fill in the value that appears in front of L.

How do you go about conducting an external

How do you go about conducting an external strategic-management audit?

The average price of milk per gallon was 226226 in 1995 and

The average price of milk per gallon was ?$2.262.26 in 1995 and ?$3.093.09 in 2010. The consumer price index was 152.4 in 1995 and 218.1 in 2010. Therefore, the real price of milk in 2010 expressed in 1995 dollars was ?$ ...

Parmigiano-reggiano global recognition of geographical

Parmigiano-Reggiano: Global Recognition of Geographical Indications What historical factors have helped support the consortium's claims for the geographic specificity of Parmigiano-Reggiano and Parmesan? What are the eco ...

My program needs to create 4 employees id 222333444555 and

My program needs to create 4 employees (ID 222,333,444,555) and then delete one (ID 333) and add a new employee (ID 666). This all works fine, my issue is that once I display the array instead of putting the new employee ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As