Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace RegularExam_UASD
- {
- internal class Coffee
- {
- //полета -> характеристики
- private string type;
- private double price;
- //конструктори
- public Coffee ()
- {
- //нов празен обект
- //type = null
- //price = 0.0
- }
- public Coffee (string type, double price)
- {
- //нов празен обект
- this.type = type;
- this.price = price;
- }
- //getters and setters
- public string Type
- {
- get
- {
- return type;
- }
- set
- {
- type = value;
- }
- }
- public double Price
- {
- get
- {
- return price;
- }
- set
- {
- price = value;
- }
- }
- public override string ToString()
- {
- return $"Coffee {Type} costs {Price:F2} lv.";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement