Advertisement
desislava_topuzakova

Flower.cs

May 15th, 2022
736
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 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.  
  7. namespace RegularExam
  8. {
  9.     internal class Flower
  10.     {
  11.         private string type;
  12.         private string color;
  13.         private double price;
  14.         public Flower(string type, string color, double price)
  15.         {
  16.             Type = type;
  17.             Color = color;
  18.             Price = price;
  19.         }
  20.  
  21.         public string Type
  22.         {
  23.             get { return type; }
  24.             set { type = value; }
  25.         }
  26.  
  27.         public string Color
  28.         {
  29.             get { return color; }
  30.             set { color = value; }
  31.         }
  32.  
  33.  
  34.         public double Price
  35.         {
  36.             get { return price; }
  37.             set { price = value; }
  38.         }
  39.  
  40.         public override string ToString()
  41.         {
  42.             return "Flower " + type + " with color " + color + " costs " + price;
  43.         }
  44.  
  45.  
  46.     }
  47. }
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement