Elffuss BraidHub

kikocis/continue public

e31fcddb0dec · 673 BRawPermalink
1using System;
2
3public class Program
4{
5 public static void Main(string[] args)
6 {
7 Console.WriteLine("Hello World!");
8 Calculator calc = new Calculator();
9 calc.Add(5).Subtract(3);
10 Console.WriteLine("Result: " + calc.GetResult());
11 }
12
13 public class Calculator
14 {
15 private double result;
16
17 public Calculator Add(double number)
18 {
19 result += number;
20 return this;
21 }
22
23 public Calculator Subtract(double number)
24 {
25 result -= number;
26 return this;
27 }
28
29 public double GetResult()
30 {
31 return result;
32 }
33 }
34}