Guest User

Untitled

a guest
Feb 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. class PencilCase
  2.     {
  3.         //variables
  4.         int pencils;
  5.         int pens;
  6.  
  7.         //c'tor
  8.         public PencilCase(int a,int b)
  9.         {
  10.             pencils = a;
  11.             pens = b;
  12.         }
  13.  
  14.         //set functions
  15.         public void AddPencil()
  16.         {
  17.             pencils++;
  18.         }
  19.  
  20.         public void SubPencil()
  21.         {
  22.             pencils--;
  23.         }
  24.  
  25.         public void AddPen()
  26.         {
  27.             pens++;
  28.         }
  29.  
  30.         public void SubPen()
  31.         {
  32.             pens--;
  33.         }
  34.  
  35.         //get functions
  36.         public int GetPencil()
  37.         {
  38.             return pencils;
  39.         }
  40.  
  41.         public int GetPen()
  42.         {
  43.             return pens;
  44.         }
  45.  
  46.     }
Add Comment
Please, Sign In to add comment