Advertisement
khang_le

Cube2Challenge

Jun 22nd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1.  
  2.     public class Cube
  3.     {
  4.         public int Side;
  5.  
  6.         public Cube(int side)
  7.         {
  8.             if (side <= 0)
  9.             {
  10.                 this.Side = Math.Abs(side);
  11.             }
  12.             else
  13.             {
  14.                 this.Side = side;
  15.             }
  16.         }
  17.  
  18.         public Cube(){
  19.             Side = 0;
  20.         }
  21.  
  22.         public void SetSide(int side)
  23.         {
  24.             if (side <= 0)
  25.             {
  26.                 this.Side = Math.Abs(side);
  27.             }
  28.             else
  29.             {
  30.                 this.Side = side;
  31.             }
  32.         }
  33.         public int GetSide()
  34.         {
  35.             return this.Side;
  36.         }
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement