Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace CalculatorApp
- {
- public interface ICalculator
- {
- int Add(int firstValue, int secondValue);
- int Subtract(int firstValue, int secondValue);
- int Multiply(int firstValue, int secondValue);
- int Divide(int firstValue, int secondValue);
- }
- public abstract class BaseCalculator : ICalculator
- {
- public virtual int Add(int firstValue, int secondValue)
- {
- return firstValue + secondValue;
- }
- public virtual int Subtract(int firstValue, int secondValue)
- {
- return firstValue - secondValue;
- }
- public virtual int Multiply(int firstValue, int secondValue)
- {
- return firstValue * secondValue;
- }
- public virtual int Divide(int firstValue, int secondValue)
- {
- return firstValue / secondValue;
- }
- }
- public class CalculatorAgent : BaseCalculator
- {
- public override int Add(int firstValue, int secondValue)
- {
- return base.Add(firstValue, secondValue);
- }
- public override int Subtract(int firstValue, int secondValue)
- {
- return base.Subtract(firstValue, secondValue);
- }
- public override int Multiply(int firstValue, int secondValue)
- {
- return base.Multiply(firstValue, secondValue);
- }
- public override int Divide(int firstValue, int secondValue)
- {
- return base.Divide(firstValue, secondValue);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement