Advertisement
Morinslash

Untitled

Nov 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1.  public class Post
  2.     {
  3.         public string Title { get;  set; }
  4.         public string Description { get;  set; }
  5.         private DateTime _whenCreated;
  6.         private int _voteValue;
  7.  
  8.         public Post()
  9.         {
  10.             _whenCreated = DateTime.Now;
  11.             _voteValue = 0;
  12.         }
  13.  
  14.         public void UpVote()
  15.         {
  16.             _voteValue++;
  17.         }
  18.  
  19.         public void DownVote()
  20.         {
  21.             _voteValue--;
  22.         }
  23.  
  24.         public int GetVoteValue()
  25.         {
  26.             return _voteValue;
  27.         }
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement