This commit is contained in:
ipvg 2024-08-18 00:26:35 -04:00
parent 3753cd4011
commit af6b5465e2
17 changed files with 1113 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
tst/ tst/
obj/ obj/
bin/ bin/
.vscode/
*.sln *.sln

View File

@ -1,4 +1,6 @@
string[] students = new string[] {"Sophia", "Nicolas", "Zahirah", "Jeong"}; string[] students = new string[] {
"Sophia", "Nicolas", "Zahirah", "Jeong"
};
int studentCount = students.Length; int studentCount = students.Length;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
// This code uses a names array and corresponding methods to display
// greeting messages
string[] names = { "Sophia", "Andrew", "AllGreetings" };
string msg_txt = "";
for (int i = 0; i < names.Length; i++){
string name = names[i];
if (name == "Sophia")
msg_txt = sophia_msg();
else if (name == "Andrew")
msg_txt = andrew_msg();
else if (name == "AllGreetings")
msg_txt = sophia_msg();
msg_txt = msg_txt + "\n\r" + andrew_msg();
Console.WriteLine(msg_txt + "\n\r");
}
bool pauseCode = true;
while (pauseCode == true);
static string sophia_msg() {
return "Hello, my name is Sophia.";
}
static string andrew_msg() {
return "Hi, my name is Andrew. Good to meet you.";
}

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

View File

@ -36,4 +36,5 @@ Following
29. [Methods that return values](./029_return_value_method/029_csharp.md) 29. [Methods that return values](./029_return_value_method/029_csharp.md)
30. [Guided project - Plan a Petting Zoo](./030_project_petting_zoo/030_csharp.md) 30. [Guided project - Plan a Petting Zoo](./030_project_petting_zoo/030_csharp.md)
31. [Challenge project - Create a mini-game](./031_Challenge_mini_game/031_csharp.md) 31. [Challenge project - Create a mini-game](./031_Challenge_mini_game/031_csharp.md)
32. [Debug console applications](./032_Debug_console_apps/032_csharp.md) 32. [Debug console applications 1](./032_Debug_console_apps/032_csharp.md)
32. [Debug console applications 2](./032_Debug_console_apps_2/033_csharp.md)