Advertisement
GreezOver

Untitled

Oct 21st, 2019
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.94 KB | None | 0 0
  1. /*1. Завдання: отримати робочу програму з простим але зрозумілим інтерфейсом для роботи з крафтовою броварнею.
  2. 2. Цілі:
  3. - досягнення робочого вигляду
  4. - відсутність суттєвих багів
  5. - перевірка на наявність дефектів, їх передбачення
  6. - підказки для користувача
  7. - інтуїтивно зрозумілий інтерфейс
  8. 3. Вимоги:
  9. Дизайн.Простий та зрозумілий інтерфейс.
  10. Функції. Перегляд інформації про наявність товару;
  11. інформації про товар(з чого виготовлений, характеристики, дата вживання тощо);
  12. додавання товару;
  13. вилучення товару;
  14. розрахування потрібної кількості інгредієнтів для виготовлення товару;
  15. перевірка на вік;
  16. врахування часу на приготування продукту
  17. тощо.
  18. 4. Термін виконання: до кінця року*/
  19.  
  20. using System;
  21. using System.Collections.Generic;
  22. using System.Linq;
  23. using System.Text;
  24. using System.Threading.Tasks;
  25.  
  26. namespace pivas
  27. {
  28.     class Brewery
  29.     {
  30.  
  31.  
  32.         public void info()
  33.         {
  34.  
  35.  
  36.         }
  37.         public Brewery()
  38.         {
  39.             string adress;
  40.             string date;
  41.  
  42.         }
  43.     }
  44.     class Beer
  45.     {
  46.         string color;
  47.         string filter;
  48.         string nameofbeer;
  49.         string bitternes;
  50.         string alcohol;
  51.         string timetodo;
  52.         string timetodrink;
  53.         //struct ingredients
  54.         //{
  55.         //    string yeats;//drojji
  56.         //    string hop;//hmel'
  57.         //    string malt;//solod
  58.         //    string water;
  59.         //    string sugar;
  60.         //}
  61.         public Beer()
  62.         {
  63.             this.color = "white";
  64.             this.filter = "filtered";
  65.             this.nameofbeer = "lager";
  66.             this.bitternes = "0";
  67.             this.alcohol = "0";
  68.             this.timetodo = "30 days";
  69.  
  70.         } //конструктор за замовчуванням
  71.         public Beer(string col, string filt, string nob, string bitt, string alco, string timedo, string timeto) {
  72.             this.color = col;
  73.             this.filter = filt;
  74.             this.nameofbeer = nob;
  75.             this.bitternes = bitt;
  76.             this.alcohol = alco;
  77.             this.timetodo = timedo;
  78.             this.timetodrink = timeto;
  79.         }//konstruktor z parametrami
  80.         public Beer(Beer obj)//konst kopiuvannia
  81.         {
  82.             this.color = obj.color;
  83.             this.filter = obj.filter;
  84.             this.nameofbeer = obj.nameofbeer;
  85.             this.bitternes = obj.bitternes;
  86.             this.alcohol = obj.alcohol;
  87.             this.timetodo = obj.timetodo;
  88.             this.timetodrink = obj.timetodrink;
  89.         }
  90.         public string Color
  91.         {
  92.             get { return this.color; }
  93.             set { this.color = value; }
  94.         }
  95.         public string Filter
  96.         {
  97.             get { return this.filter; }
  98.             set { this.filter = value; }
  99.         }
  100.         public string Nameofbeer
  101.         {
  102.             get { return this.nameofbeer; }
  103.             set { this.nameofbeer = value; }
  104.         }
  105.         public string Bitternes
  106.         {
  107.             get { return this.bitternes; }
  108.             set { this.bitternes = value; }
  109.         }
  110.         public string Alcohol
  111.         {
  112.             get { return this.alcohol; }
  113.             set { this.alcohol = value; }
  114.         }
  115.         public string Timetodo
  116.         {
  117.             get { return this.timetodo; }
  118.             set { this.timetodo = value; }
  119.         }
  120.         public string TАimetodrink
  121.         {
  122.             get { return this.timetodrink; }
  123.             set { this.timetodrink = value; }
  124.         }
  125.     }
  126.  
  127.     class Person
  128.     {
  129.        
  130.         string fname;//im`a
  131.         string fathername;//ot4estvo
  132.         string sname;//familia
  133.        
  134.         //struct register
  135.         //{
  136.         //    string email;
  137.         //    string nickname;
  138.         //    string password1;
  139.         //    string password2;
  140.  
  141.         //}
  142.        
  143.        
  144.         public Person(string f_n, string father_n, string s_n)
  145.         {
  146.             this.fname = f_n;
  147.             this.fathername = father_n;
  148.             this.sname = s_n;
  149.         }
  150.         public Person() : this("Unknown", "Unknown", "Unknown") { }//konst za zamov4
  151.         public Person(Person obj) : this(obj.fname, obj.fathername, obj.sname) { }//konstruktor kopiuvannia
  152.     }
  153.  
  154.     class Buyer : Person
  155.     {
  156.         int age;
  157.         public Buyer()
  158.         {
  159.            
  160.         }
  161.     }
  162.     class Worker
  163.     {
  164.         public Worker()
  165.         {
  166.  
  167.         }
  168.     }
  169.     class Seller : Worker
  170.     {
  171.         public Seller()
  172.         {
  173.  
  174.         }
  175.     }
  176.     class Administrator : Worker
  177.     {
  178.         public Administrator()
  179.         {
  180.  
  181.         }
  182.     }
  183.  
  184.  
  185.     class Program
  186.  
  187.     {
  188.         static void Main(string[] args)
  189.         {
  190.             int num;
  191.             Console.WriteLine("Who are you?\nI'm:\n1. seller\n2. buyer\n3. administrator");
  192.             num = Convert.ToInt32(Console.ReadLine());
  193.             switch (num)
  194.             {
  195.                 case 1:
  196.                     Console.WriteLine("Please sign in");
  197.                     Console.ReadLine();
  198.                     break;
  199.                 case 2:
  200.                     Console.WriteLine("Please sign in or sign up");
  201.                     break;
  202.                 case 3:
  203.                     Console.WriteLine("Please sign in");
  204.                     break;
  205.                 default:
  206.                     Console.WriteLine("Incorrect symbol");
  207.                     break;
  208.             }
  209.  
  210.         }
  211.     }
  212. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement