Last active
January 28, 2021 11:45
-
-
Save mkojoa/e66ddcbc4fa5e560299ea2a10c1b6935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace App | |
{ | |
class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
Programmer | |
.Name("Michael Ameyaw") | |
.Prepare("Cofee Drink") | |
.WithSupplement("Pie") | |
.RepeatEvery("Monday") | |
.Serve(); | |
Console.ReadKey(); | |
} | |
} | |
public class Programmer | |
{ | |
public static string _Name { get; set; } | |
public static string _Drink { get; set; } | |
public static string _Supplement { get; set; } | |
public static string _Repeat { get; set; } | |
public static Programmer Name(string name) | |
{ | |
_Name = name; | |
return new Programmer(); | |
} | |
public static Programmer Name(string name, string email) | |
{ | |
_Name = name; | |
return new Programmer(); | |
} | |
public Programmer Prepare(string drink) | |
{ | |
_Drink = drink; | |
return this; | |
} | |
public Programmer RepeatEvery(string repeat) | |
{ | |
_Repeat = repeat; | |
return this; | |
} | |
public Programmer WithSupplement(string supplement) | |
{ | |
_Supplement = supplement; | |
return this; | |
} | |
public void Serve() | |
{ | |
Console.WriteLine( | |
$"Hello " + | |
$"{_Name}" + | |
$", your drink " + | |
$"{_Drink}" + | |
$" and with suplement " + | |
$"{_Supplement} " + | |
$"has been prepared by our AI. This will be repeated every " + | |
$"{_Repeat}" | |
); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment