SwitchOppgave
This commit is contained in:
parent
37e271fd9e
commit
2c097039f6
16
Emne 3/SwitchOppgaver/SwitchOppgaver.sln
Normal file
16
Emne 3/SwitchOppgaver/SwitchOppgaver.sln
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SwitchOppgaver", "SwitchOppgaver\SwitchOppgaver.csproj", "{CD56EE4A-C7E4-4163-901D-DEEC9E0AFEB2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CD56EE4A-C7E4-4163-901D-DEEC9E0AFEB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CD56EE4A-C7E4-4163-901D-DEEC9E0AFEB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CD56EE4A-C7E4-4163-901D-DEEC9E0AFEB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CD56EE4A-C7E4-4163-901D-DEEC9E0AFEB2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
33
Emne 3/SwitchOppgaver/SwitchOppgaver/Program.cs
Normal file
33
Emne 3/SwitchOppgaver/SwitchOppgaver/Program.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
|
||||
namespace SwitchOppgaver
|
||||
{
|
||||
class SwitchDay
|
||||
{
|
||||
static private void WhichDay(){
|
||||
Console.WriteLine("Enter Day Number: ");
|
||||
var day= Convert.ToInt32(Console.ReadLine());
|
||||
|
||||
var WhichDay = day switch
|
||||
{
|
||||
1 => "Monday",
|
||||
2 => "Tuesday",
|
||||
3 => "Wednesday",
|
||||
4 => "Thursday",
|
||||
5 => "Friday",
|
||||
6 => "Saturday",
|
||||
7 => "Sunday",
|
||||
_ => "Invalid day",
|
||||
};
|
||||
Console.WriteLine($"{WhichDay}");
|
||||
}
|
||||
|
||||
class Run
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
WhichDay();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
10
Emne 3/SwitchOppgaver/SwitchOppgaver/SwitchOppgaver.csproj
Normal file
10
Emne 3/SwitchOppgaver/SwitchOppgaver/SwitchOppgaver.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>
|
Loading…
Reference in a new issue