From 466faca463a8c7e5e5d9417bb528e54a2a7b9643 Mon Sep 17 00:00:00 2001 From: Nikhil Prasad Date: Wed, 19 Jun 2019 20:01:40 +0530 Subject: [PATCH] Added starter code. --- .../xs/UserPrefs.xml | 25 +++++++++++++++++ Tavisca.Bootcamp.LanguageBasics.Exercise1.sln | 17 +++++++++++ .../Program.cs | 28 +++++++++++++++++++ ...a.Bootcamp.LanguageBasics.Exercise1.csproj | 8 ++++++ 4 files changed, 78 insertions(+) create mode 100644 .vs/Tavisca.Bootcamp.LanguageBasics.Exercise1/xs/UserPrefs.xml create mode 100644 Tavisca.Bootcamp.LanguageBasics.Exercise1.sln create mode 100644 Tavisca.Bootcamp.LanguageBasics.Exercise1/Program.cs create mode 100644 Tavisca.Bootcamp.LanguageBasics.Exercise1/Tavisca.Bootcamp.LanguageBasics.Exercise1.csproj diff --git a/.vs/Tavisca.Bootcamp.LanguageBasics.Exercise1/xs/UserPrefs.xml b/.vs/Tavisca.Bootcamp.LanguageBasics.Exercise1/xs/UserPrefs.xml new file mode 100644 index 0000000..caaaba1 --- /dev/null +++ b/.vs/Tavisca.Bootcamp.LanguageBasics.Exercise1/xs/UserPrefs.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tavisca.Bootcamp.LanguageBasics.Exercise1.sln b/Tavisca.Bootcamp.LanguageBasics.Exercise1.sln new file mode 100644 index 0000000..ee2733a --- /dev/null +++ b/Tavisca.Bootcamp.LanguageBasics.Exercise1.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tavisca.Bootcamp.LanguageBasics.Exercise1", "Tavisca.Bootcamp.LanguageBasics.Exercise1\Tavisca.Bootcamp.LanguageBasics.Exercise1.csproj", "{7668201A-A7B7-4EEB-A69B-1BC4E4B52328}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7668201A-A7B7-4EEB-A69B-1BC4E4B52328}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7668201A-A7B7-4EEB-A69B-1BC4E4B52328}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7668201A-A7B7-4EEB-A69B-1BC4E4B52328}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7668201A-A7B7-4EEB-A69B-1BC4E4B52328}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Tavisca.Bootcamp.LanguageBasics.Exercise1/Program.cs b/Tavisca.Bootcamp.LanguageBasics.Exercise1/Program.cs new file mode 100644 index 0000000..bd75b42 --- /dev/null +++ b/Tavisca.Bootcamp.LanguageBasics.Exercise1/Program.cs @@ -0,0 +1,28 @@ +using System; + +namespace Tavisca.Bootcamp.LanguageBasics.Exercise1 +{ + class Program + { + static void Main(string[] args) + { + Test("42*47=1?74", 9); + Test("4?*47=1974", 2); + Test("42*?7=1974", 4); + Test("42*?47=1974", -1); + Test("2*12?=247", -1); + } + + private static void Test(string args, int expected) + { + var result = FindDigit(args).Equals(expected) ? "PASS" : "FAIL"; + Console.WriteLine($"{args} : {result}"); + } + + public static int FindDigit(string equation) + { + // Add your code here. + throw new NotImplementedException(); + } + } +} diff --git a/Tavisca.Bootcamp.LanguageBasics.Exercise1/Tavisca.Bootcamp.LanguageBasics.Exercise1.csproj b/Tavisca.Bootcamp.LanguageBasics.Exercise1/Tavisca.Bootcamp.LanguageBasics.Exercise1.csproj new file mode 100644 index 0000000..01d5113 --- /dev/null +++ b/Tavisca.Bootcamp.LanguageBasics.Exercise1/Tavisca.Bootcamp.LanguageBasics.Exercise1.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.2 + + +