Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions FizzBuzz/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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}"
}
,]
}
15 changes: 15 additions & 0 deletions FizzBuzz/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/FizzBuzz.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
38 changes: 35 additions & 3 deletions FizzBuzz/FizzBuzz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}}
28 changes: 28 additions & 0 deletions PigLatin/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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}"
}
,]
}
15 changes: 15 additions & 0 deletions PigLatin/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/PigLatin.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
28 changes: 28 additions & 0 deletions gradebook/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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}"
}
,]
}
15 changes: 15 additions & 0 deletions gradebook/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/gradebook.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
55 changes: 55 additions & 0 deletions gradebook/Program.cs
Original file line number Diff line number Diff line change
@@ -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<string, int[]> gradez = new Dictionary<string, int[]>();
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);
}
}
}
}
}
8 changes: 8 additions & 0 deletions gradebook/gradebook.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

</Project>