Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
25 changes: 24 additions & 1 deletion Checkpoint1/Checkpoint1.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
using System;
using System.Collections.Generic;

namespace Checkpoint1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
//continue to ask for numbers and add them together
bool exit = false;
List<int> playerNumbersList = new List<int> { };
while (!exit)
{
Console.WriteLine("Enter number or ok to exit");
string userResponse = Console.ReadLine();
if (userResponse == "ok")
{
exit = true;
}
else
{
playerNumbersList.Add(Convert.ToInt32(userResponse));
}
}
// put all results here
int result = 0;
for (int i = 0; i < playerNumbersList.Count; i++)
{
result = result + playerNumbersList[i];
}
Console.WriteLine(result);
}
}
}
26 changes: 26 additions & 0 deletions DivByThree/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/DivByThree.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
15 changes: 15 additions & 0 deletions DivByThree/.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}/DivByThree.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
8 changes: 8 additions & 0 deletions DivByThree/DivByThree.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.2</TargetFramework>
</PropertyGroup>

</Project>
22 changes: 22 additions & 0 deletions DivByThree/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;

namespace DivByThree
{
class Program
{
static void Main(string[] args)
{
int how_many = 0;

for (int i = 1; i <= 100; i++)
{
if (i % 3 == 0)
{
how_many++;
}
}

Console.WriteLine(how_many);
}
}
}
8 changes: 8 additions & 0 deletions FindBiggest/FindBiggest.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.2</TargetFramework>
</PropertyGroup>

</Project>
36 changes: 36 additions & 0 deletions FindBiggest/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;

namespace FindBiggest
{
class Program
{
static void Main(string[] args)
{
//continue to ask for numbers and return the highest
int highest_number = 0;
string current_number;
bool exit = false;
while (!exit)
{
Console.WriteLine("enter a number or e for exit");
try
{
current_number = Console.ReadLine();
int number = Convert.ToInt32(current_number);
if (number > highest_number)
{
highest_number = number;
}
}
catch (System.Exception)
{

exit = true;

}
}

Console.WriteLine("Your Highest Number is {0}", highest_number);
}
}
}
20 changes: 18 additions & 2 deletions RockPaperScissors/RockPaperScissors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,27 @@ public static void Main()
{
while (playAgain == true)
{
string hand1 = null;
string hand2 = "";
Console.Clear();
Console.WriteLine("Enter hand 1:");
string hand1 = Console.ReadLine().ToLower();
try
{
hand1 = Console.ReadLine().ToLower();
}
catch (System.Exception)
{
Console.WriteLine("invalid selection");
}
Console.WriteLine("Enter hand 2 or c for a computer player");
string hand2 = Console.ReadLine().ToLower();
try
{
hand2 = Console.ReadLine().ToLower();
}
catch (System.Exception)
{
Console.WriteLine("invalid selection");
}
string showWinner = (CompareHands(hand1, hand2));
string[] splitResults = showWinner.Split('*');
string winnerText = splitResults[0];
Expand Down
26 changes: 26 additions & 0 deletions candles/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/candles.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
15 changes: 15 additions & 0 deletions candles/.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}/candles.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
27 changes: 27 additions & 0 deletions candles/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;

namespace candles
{
class Program
{
static void Main(string[] args)
{
int[] numberOfCandles = { 1, 3, 2, 6, 7, 9, 9, 8, 7, 3, 9, };
int largest = 0;
int howManyCandles = 1;
foreach (var num in numberOfCandles)
{
if (num > largest)
{
largest = num;
howManyCandles = 1;
}
else if (num == largest)
{
howManyCandles++;
}
}
Console.WriteLine("they can blow out {0} candles", howManyCandles);
}
}
}
8 changes: 8 additions & 0 deletions candles/candles.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.2</TargetFramework>
</PropertyGroup>

</Project>
26 changes: 26 additions & 0 deletions checkpoint1Factorial/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/checkpoint1Factorial.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
15 changes: 15 additions & 0 deletions checkpoint1Factorial/.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}/checkpoint1Factorial.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
19 changes: 19 additions & 0 deletions checkpoint1Factorial/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;

namespace checkpoint1Factorial
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("enter a number for factorial");
int userNumber = Convert.ToInt32(Console.ReadLine());
for (int i = userNumber - 1; i > 0; i--)
{
userNumber = userNumber * i;
}
Console.WriteLine("the factorial is {0}", userNumber);

}
}
}
8 changes: 8 additions & 0 deletions checkpoint1Factorial/checkpoint1Factorial.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.2</TargetFramework>
</PropertyGroup>

</Project>
26 changes: 26 additions & 0 deletions guessingGame/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/guessingGame.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
15 changes: 15 additions & 0 deletions guessingGame/.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}/guessingGame.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
Loading