Advertisement
markovood

Untitled

Mar 25th, 2020
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. namespace PizzaCalories
  2. {
  3.     public abstract class Ingredient
  4.     {
  5.         protected const double BASE_CALORIES_PER_GRAM = 2.0;
  6.                
  7.         public abstract double WeightGR { get; protected set; }
  8.  
  9.         public double CaloriesPerGR
  10.         {
  11.             get => BASE_CALORIES_PER_GRAM * this.Modifier;
  12.         }
  13.  
  14.         protected double Modifier { get; set; }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement