Objects and Enums test
This commit is contained in:
parent
3118086163
commit
62b9bfb0fd
15
Emne 3/ObjectsAndEnums/Box.cs
Normal file
15
Emne 3/ObjectsAndEnums/Box.cs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
namespace ObjectsAndEnums
|
||||||
|
{
|
||||||
|
|
||||||
|
public class Box
|
||||||
|
{
|
||||||
|
public int Width;
|
||||||
|
public int Height;
|
||||||
|
|
||||||
|
internal void Show()
|
||||||
|
{
|
||||||
|
Console.WriteLine("Boksen har disse målene: " + Width + "x" + Height);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
12
Emne 3/ObjectsAndEnums/DaysOfWeek.cs
Normal file
12
Emne 3/ObjectsAndEnums/DaysOfWeek.cs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
namespace ObjectsAndEnums;
|
||||||
|
|
||||||
|
public enum DaysOfWeek
|
||||||
|
{
|
||||||
|
Monday,
|
||||||
|
Tuesday,
|
||||||
|
Wednesday,
|
||||||
|
Thursday,
|
||||||
|
Friday,
|
||||||
|
Saturday,
|
||||||
|
Sunday,
|
||||||
|
}
|
10
Emne 3/ObjectsAndEnums/ObjectsAndEnums.csproj
Normal file
10
Emne 3/ObjectsAndEnums/ObjectsAndEnums.csproj
Normal 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>
|
16
Emne 3/ObjectsAndEnums/ObjectsAndEnums.sln
Normal file
16
Emne 3/ObjectsAndEnums/ObjectsAndEnums.sln
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectsAndEnums", "ObjectsAndEnums.csproj", "{987031C2-BDA2-4A1D-941F-DCB9C06DD053}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{987031C2-BDA2-4A1D-941F-DCB9C06DD053}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{987031C2-BDA2-4A1D-941F-DCB9C06DD053}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{987031C2-BDA2-4A1D-941F-DCB9C06DD053}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{987031C2-BDA2-4A1D-941F-DCB9C06DD053}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
29
Emne 3/ObjectsAndEnums/Program.cs
Normal file
29
Emne 3/ObjectsAndEnums/Program.cs
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
namespace ObjectsAndEnums
|
||||||
|
{
|
||||||
|
internal class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Tester Klasser og Enums");
|
||||||
|
var box = new Box();
|
||||||
|
box.Width = 100;
|
||||||
|
box.Height = 100;
|
||||||
|
box.Show();
|
||||||
|
DaysOfWeek day = DaysOfWeek.Monday;
|
||||||
|
|
||||||
|
switch (day)
|
||||||
|
{
|
||||||
|
case DaysOfWeek.Monday:
|
||||||
|
Console.WriteLine("Monday");
|
||||||
|
break;
|
||||||
|
case DaysOfWeek.Tuesday:
|
||||||
|
Console.WriteLine("Tuesday");
|
||||||
|
break;
|
||||||
|
default: Console.WriteLine("Unknown day");
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
10
Emne 3/Pokemon/Pokemon.csproj
Normal file
10
Emne 3/Pokemon/Pokemon.csproj
Normal 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>
|
16
Emne 3/Pokemon/Pokemon.sln
Normal file
16
Emne 3/Pokemon/Pokemon.sln
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pokemon", "Pokemon.csproj", "{B5E5E3C3-6454-46D3-848D-7DE15A01B6A2}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{B5E5E3C3-6454-46D3-848D-7DE15A01B6A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B5E5E3C3-6454-46D3-848D-7DE15A01B6A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B5E5E3C3-6454-46D3-848D-7DE15A01B6A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B5E5E3C3-6454-46D3-848D-7DE15A01B6A2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
1
Emne 3/Pokemon/Program.cs
Normal file
1
Emne 3/Pokemon/Program.cs
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
Loading…
Reference in a new issue