Guest User

bet.cs

a guest
Jun 15th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7.  
  8. namespace BetDogsHeadFirst
  9. {
  10.     public class Bet
  11.     {
  12.         public int amount;
  13.         public int dog;
  14.         public Guy bettor;
  15.  
  16.         public string GetDescription()
  17.         {
  18.             string labelBetDescription = "";
  19.             if(amount>0)
  20.             {
  21.                 labelBetDescription = bettor.name + " bet " + amount + "on dog #" + dog;
  22.             }
  23.             else
  24.             {
  25.                 labelBetDescription= bettor.name + " hasn't place a bet";
  26.             }
  27.             return labelBetDescription;
  28.         }
  29.  
  30.         public int PayOut(int winner)
  31.         {
  32.             if (dog == winner)
  33.                 return amount;
  34.             else
  35.                 return -amount;
  36.         }
  37.  
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment