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 AnimalClassification/.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/AnimalClassification.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 AnimalClassification/.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}/AnimalClassification.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
8 changes: 8 additions & 0 deletions AnimalClassification/AnimalClassification.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>
56 changes: 56 additions & 0 deletions AnimalClassification/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;

namespace AnimalClassification
{

public class Animal {

}

class Vertebrate : Animal {

}

class Invertebrate : Animal {

}

class WarmBlooded : Vertebrate {

}

class ColdBlooded : Vertebrate {

}

class WithLegs : Invertebrate {

}

class WithoutLegs : Invertebrate {

}

class Mammals : WarmBlooded {
bool livesOnLand;

}
class Birds : WarmBlooded {}
class Fish : ColdBlooded {}
class Reptiles : ColdBlooded {}
class Amphibians : ColdBlooded {}
class ThreePairsOfLegs : WithLegs {}
class MoreThanThreePairsOfLegs : WithLegs {}
class WormLike : WithoutLegs {}
class NotWormLike : WithoutLegs {}



class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
28 changes: 28 additions & 0 deletions CarInheritance/.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/CarInheritance.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 CarInheritance/.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}/CarInheritance.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
8 changes: 8 additions & 0 deletions CarInheritance/CarInheritance.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>
91 changes: 91 additions & 0 deletions CarInheritance/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
using System;

namespace CarInheritance
{
class Program
{






static void Main(string[] args)
{
Van aVan = new Van(true,true,"white",4,4,true,6);
Truck gravedigga = new Truck(1,4,"green and black like a can of Monster",4,4,true,6);
Motorcycle aMotorcycle = new Motorcycle(true, true, "red", 3, 2, true, 4);


Console.WriteLine("Inheritance practice!");

Console.WriteLine("aTruck's color is " + aVan.color);
Console.WriteLine("aMotorcycle's color is " + aMotorcycle.color);
Console.WriteLine("Gravedigga's color is " + gravedigga.color);

Console.WriteLine("aVan honks like " + aVan.honk());
Console.WriteLine("Gravedigga honks like " + gravedigga.honk());
Console.WriteLine("aMotorcycle honks like " + aMotorcycle.honk());
}
}

public class Vehicle{
public string color {get;set;}
public int numWheels {get;set;}
public int numPassengers {get;set;}
public bool gasPowered {get;set;}
public int engineSize {get;set;}
public virtual String honk(){
return "honk honk";
}


public Vehicle(string color, int numWheels, int numPassengers, bool gasPowered, int engineSize){
this.color = color;
this.numWheels = numWheels;
this.numPassengers = numPassengers;
this.gasPowered = gasPowered;
this.engineSize = engineSize;
}
}

public class Truck : Vehicle {
public int cabSize {get;set;}
public int towingCapacity {get;set;}

public override String honk(){
return "B I G G H O N C C";
}

public Truck(int cabSize, int towingCapacity, string color, int numWheels, int numPassengers, bool gasPowered, int engineSize) : base(color, numWheels, numPassengers, gasPowered, engineSize){
this.numWheels = numWheels;
this.cabSize = cabSize;
this.towingCapacity = towingCapacity;

}
}

public class Motorcycle : Vehicle {
public bool isCruiser {get;set;}
public bool hasSidecar {get;set;}
public override String honk(){
return "beep beep";
}
public Motorcycle(bool isCruiser, bool hasSidecar, string color, int numWheels, int numPassengers, bool gasPowered, int engineSize) : base(color, numWheels, numPassengers, gasPowered, engineSize){
this.isCruiser = isCruiser;
this.hasSidecar = hasSidecar;
}
}

public class Van : Vehicle {
public bool hasSlidingDoor {get;set;}
public bool isCargoVan {get;set;}

public Van(bool hasSlidingDoor, bool isCargoVan, string color, int numWheels, int numPassengers, bool gasPowered, int engineSize) : base(color, numWheels, numPassengers, gasPowered, engineSize){
this.hasSlidingDoor = hasSlidingDoor;
this.isCargoVan = isCargoVan;
}
}


}
28 changes: 28 additions & 0 deletions Mastermind/.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/Mastermind.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 Mastermind/.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}/Mastermind.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
Loading