Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CalculatorTest
- {
- public interface ICalculator
- {
- int writeNumber();
- string writeText { get; set; }
- int operand1 { get; set; }
- int operand2 { get; set; }
- }
- public class Calculator : ICalculator
- {
- public string writeText { get; set; }
- public int operand1 { get; set; }
- public int operand2 { get; set; }
- public int writeNumber()
- {
- return operand1 + operand2;
- }
- public Calculator(int operand1, int operand2)
- {
- this.operand1 = operand1;
- this.operand2 = operand2;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- ICalculator Clc = new Calculator(50, 31);
- Clc.writeText = "Hello!";
- Clc.writeNumber();
- Console.WriteLine(Clc.writeText);
- Console.WriteLine(Clc.writeNumber());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement