Advertisement
AvengersAssemble

Q6

Nov 2nd, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4. using Unit4;
  5. using Unit4.CollectionsLib;
  6.  
  7. namespace Lab4
  8. {
  9.     //Q6
  10.     public class Flower
  11.     {
  12.         private string name;
  13.         private string type;
  14.         private double price;
  15.         public Flower(string name, string type, double price)
  16.         {
  17.             this.name = name;
  18.             this.type = type;
  19.             this.price = price;
  20.         }
  21.         public string Name
  22.         {
  23.             get { return this.name; }
  24.             set { this.name = value; }
  25.         }
  26.         public string Type
  27.         {
  28.             get { return this.type; }
  29.             set { this.type = value; }
  30.         }
  31.         public double Price
  32.         {
  33.             get { return this.price; }
  34.             set { this.price = value; }
  35.         }
  36.  
  37.         public override string ToString()
  38.         {
  39.             return string.Format("Name: {0} \nType: {1} \nPrice: {2}", this.name, this.type, this.price);
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement