Method declares several circle objects

Assignment Help Business Management
Reference no: EM131878765

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;

}

}

Reference no: EM131878765

Questions Cloud

How long must man live so that first option is better deal : The relevant interest rate is 6% per year compounding monthly. How long must the man live so that the first option is a better deal?
What is the nominal interest rate on this loan : What is the effective monthly rate on this loan? what is the nominal (annual) interest rate on this loan?
Describes gaap accounting for this call option : Which of the following accurately describes GAAP accounting for this call option?
Assignment instructions-python : Develop a Python application that incorporates using appropriate data types and provides program output in a logical manner.
Method declares several circle objects : a class named TestCircle whose main() method declares several Circle objects. Using the setRadius() method, assign one Circle a small radius value
Put money in four stocks in dollar amounts indicated : An investor has put money in four stocks in the dollar amounts indicated and with betas specified. What is the portfolio beta?
Demonstrate your understanding of ren and other key concepts : Demonstrate your understanding of Ren and other key concepts of Confucian ethics by choosing one of the following options.
Calculate the genworth ndi for the borrowers : Assignment Certificate IV in Finance and Mortgage Broking - calculate the Genworth NDI for the borrowers. This will require you to enter all the data
Return the price of the product id entered in cell : If true, return an empty text string. If false, return the price of the product ID entered in cell D13.

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

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