Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. namespace assignment_2_question_4_main_method
  2. {
  3.     public class Circle
  4.     {
  5.         private double radius;
  6.         private const double PI = 3.14159;
  7.         // Constructor (no argument)
  8.         public Circle()
  9.         {
  10.             // insert code here
  11.             radius = 0.0;
  12.         }
  13.         // Constructor
  14.         public Circle(double rad)
  15.         {
  16.             // insert code here
  17.             radius = rad;
  18.         }
  19.         // SetRadius
  20.         public void SetRadius(double rad)
  21.         {
  22.             // insert code here
  23.             radius = rad;
  24.         }
  25.         // GetRadius
  26.         public double GetRadius()
  27.         {
  28.             // insert code here
  29.             return radius;
  30.         }
  31.         // GetArea
  32.         public double GetArea()
  33.         {
  34.             // insert code here
  35.             return PI * (radius * radius);
  36.  
  37.         }
  38.         // GetCircumference
  39.         public double GetCircumference()
  40.         {
  41.             // insert code here
  42.             return 2 * PI * radius;
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement