Add feat: Debugging testing

This commit is contained in:
Isaac Alter 2023-07-22 02:28:45 -06:00
parent a8f1f96a7c
commit fc122d41a7
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,34 @@
/*
This code uses a names array and corresponding methods to display
greeting messages
*/
string[] names = new string[] { "Sophia", "Andrew", "AllGreetings" };
string messageText = "";
foreach (string name in names)
{
if (name == "Sophia")
messageText = SophiaMessage();
else if (name == "Andrew")
messageText = AndrewMessage();
else if (name == "AllGreetings")
messageText = SophiaMessage();
messageText = messageText + "\n\r" + AndrewMessage();
Console.WriteLine(messageText + "\n\r");
}
bool pauseCode = true;
while (pauseCode == true);
static string SophiaMessage()
{
return "Hello, my name is Sophia.";
}
static string AndrewMessage()
{
return "Hi, my name is Andrew. Good to meet you.";
}