diff --git a/FizzBuzz/.vscode/launch.json b/FizzBuzz/.vscode/launch.json new file mode 100644 index 00000000..6864d0ad --- /dev/null +++ b/FizzBuzz/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/FizzBuzz.dll", + "args": [], + "cwd": "${workspaceFolder}", + // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ,] +} \ No newline at end of file diff --git a/FizzBuzz/.vscode/tasks.json b/FizzBuzz/.vscode/tasks.json new file mode 100644 index 00000000..cbc29d9f --- /dev/null +++ b/FizzBuzz/.vscode/tasks.json @@ -0,0 +1,15 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/FizzBuzz.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/FizzBuzz/FizzBuzz.cs b/FizzBuzz/FizzBuzz.cs index 9246f703..2542ade5 100644 --- a/FizzBuzz/FizzBuzz.cs +++ b/FizzBuzz/FizzBuzz.cs @@ -6,7 +6,39 @@ class Program { static void Main(string[] args) { - Console.WriteLine("Hello World!"); - } + int number = 0; + RequestSustenance(); + BuzzBeast(); + Console.ReadLine(); + + void BuzzBeast(){ + int i = 0; + while (i < number) + { + i++; + if (i % 3 == 0 && i % 5 == 0) + { + Console.WriteLine("FIZZBUZZ, the wild beast howls"); + + } + else if (i % 3 == 0){ + Console.WriteLine("FIZZ, the creature foams at the mouth"); + + } + else if (i % 5 == 0){ + Console.WriteLine("BUZZ, the creature emits poisonous clouds from its pores"); + + } + else { + Console.WriteLine(i); + } + } + } + void RequestSustenance() + { + Console.WriteLine("FEED ME AN INTEGER. I SUFFER FROM ANCIENT HUNGER."); + number = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("YES, GOOD, YOUR NUMBER IS " + number); + } } -} +}} diff --git a/PigLatin/.vscode/launch.json b/PigLatin/.vscode/launch.json new file mode 100644 index 00000000..dbee6e56 --- /dev/null +++ b/PigLatin/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/PigLatin.dll", + "args": [], + "cwd": "${workspaceFolder}", + // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ,] +} \ No newline at end of file diff --git a/PigLatin/.vscode/tasks.json b/PigLatin/.vscode/tasks.json new file mode 100644 index 00000000..a705ed07 --- /dev/null +++ b/PigLatin/.vscode/tasks.json @@ -0,0 +1,15 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/PigLatin.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/gradebook/.vscode/launch.json b/gradebook/.vscode/launch.json new file mode 100644 index 00000000..46ba609f --- /dev/null +++ b/gradebook/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/bin/Debug/netcoreapp2.1/gradebook.dll", + "args": [], + "cwd": "${workspaceFolder}", + // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ,] +} \ No newline at end of file diff --git a/gradebook/.vscode/tasks.json b/gradebook/.vscode/tasks.json new file mode 100644 index 00000000..133b93a8 --- /dev/null +++ b/gradebook/.vscode/tasks.json @@ -0,0 +1,15 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/gradebook.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/gradebook/Program.cs b/gradebook/Program.cs new file mode 100644 index 00000000..8e10875b --- /dev/null +++ b/gradebook/Program.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace gradebook +{ + class Program + { + static void Main(string[] args) + { + Stack studentz = new Stack(); + Dictionary gradez = new Dictionary(); + Console.WriteLine("Dictionary and Stack Practice"); + + GetStudentName(); + GetGrades(); + + void GetStudentName(){ + + Console.WriteLine("Please enter a student name, or type \"done\" when done."); + string input = Console.ReadLine(); + if (input == "done") + { + GetGrades(); + } + else + { + studentz.Push(input); + GetStudentName(); + } + } + + void GetGrades(){ + foreach (string student in studentz) + { + Console.WriteLine("Please enter the grades for " + student + ", with commas in between the grades"); + string input = Console.ReadLine(); + string[] gradeArray = (input).Split(","); + int[] gradeArrayInt = new int[gradeArray.Length]; + for (int i = 0; i < gradeArray.Length; i++) + { + if (Int32.TryParse(gradeArray[i], out gradeArrayInt[i])) + { + } + else + { + Console.WriteLine("One of your inputs was invalid, please try again"); + } + } + gradez.Add(student, gradeArrayInt); + } + } + } + } +} diff --git a/gradebook/gradebook.csproj b/gradebook/gradebook.csproj new file mode 100644 index 00000000..23df6047 --- /dev/null +++ b/gradebook/gradebook.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.1 + + +