Advertisement
VuGal

C# pytanie

Feb 26th, 2020
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. namespace Lab1
  2. {
  3.     class RightTriangle
  4.     {
  5.  
  6.         private double a, b;
  7.        
  8.         public double A
  9.         {
  10.             get { return a; }
  11.             set
  12.             {
  13.                 if (value > 0) a = value;
  14.             }
  15.         }
  16.         public double B
  17.         {
  18.             get { return b; }
  19.             set
  20.             {
  21.                 if (value > 0) b = value;
  22.             }
  23.         }
  24.  
  25.         private double ComputeC()
  26.         {
  27.             //return Math.Sqrt(a * a + b * b);     //which is correct?
  28.             //return Math.Sqrt(A * A + B * B);
  29.         }
  30.  
  31.         public double ComputeSine()
  32.         {
  33.             return ComputeC() / a;
  34.         }
  35.  
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement