Jay Patel

Jay Patel

  • NA
  • 21
  • 14.2k

C# beginner language

Feb 10 2015 1:52 PM
this program should include classes and methods also should be in simple c# language.. not high class coding.
Create a class named Circle with fields named radius, area, and diameter. Include a constructor that sets the radius to 1. Also include public properties for each field. The Radius property should have get and set accessors, but Area and Diameter should be read-only. The set accessor for the radius should also provide values for the diameter and area. (The diameter of a circle is twice its radius; the area is pi multiplied by the square of the radius. You can use the public Math class property Math.PI for the value of pi.) Create a program named TestCircles whose Main() method declares three Circle objects. Assign a small radius value to one Circle and assign a larger radius value to another Circle. Do not assign a value to the radius of the third circle; instead, retain the value assigned at construction. Display the radius, diameter, and area for each Circle. (Display the area to two decimal places.) 

Answers (1)