Advertisement
alexbancheva

Santa's Bag of Presents_class Present

Jun 19th, 2020
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace Christmas
  6. {
  7.     public class Present
  8.     {
  9.         public Present(string name, double weight, string gender)
  10.         {
  11.             this.Name = name;
  12.             this.Weight = weight;
  13.             this.Gender = gender;
  14.         }
  15.  
  16.         public string Name { get; set; }
  17.  
  18.         public double Weight { get; set; }
  19.  
  20.         public string Gender { get; set; }
  21.  
  22.         public override string ToString()
  23.         {
  24.             return $"Present {this.Name} ({this.Weight}) for a {this.Gender}";
  25.         }
  26.  
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement