Initial commit
This commit is contained in:
10
ConsoleApp6/ConsoleApp6.csproj
Normal file
10
ConsoleApp6/ConsoleApp6.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>
|
||||
25
ConsoleApp6/ConsoleApp6.sln
Normal file
25
ConsoleApp6/ConsoleApp6.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36518.9 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp6", "ConsoleApp6.csproj", "{940F1903-DF3A-47BA-AC39-51510154D234}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{940F1903-DF3A-47BA-AC39-51510154D234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{940F1903-DF3A-47BA-AC39-51510154D234}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{940F1903-DF3A-47BA-AC39-51510154D234}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{940F1903-DF3A-47BA-AC39-51510154D234}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {23F5A8E3-F2B6-42A3-8631-964DB367B11C}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
38
ConsoleApp6/Program.cs
Normal file
38
ConsoleApp6/Program.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
namespace c.pc
|
||||
{
|
||||
public class TemperatureConvertor
|
||||
{
|
||||
public static double CtoF(string c)
|
||||
{
|
||||
double cl = Double.Parse(c);
|
||||
double fl = (cl * 9 / 5) + 32;
|
||||
return fl;
|
||||
}
|
||||
public double FtoC(string f)
|
||||
{
|
||||
double fl = Double.Parse(f);
|
||||
double cl = (fl - 32) * 5 / 9;
|
||||
return cl;
|
||||
}
|
||||
}
|
||||
class Test
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
string selection = Console.ReadLine();
|
||||
double F, C = 0;
|
||||
TemperatureConvertor tc = new TemperatureConvertor();
|
||||
switch (selection)
|
||||
{
|
||||
case "1":
|
||||
F = TemperatureConvertor.CtoF(Console.ReadLine()); break;
|
||||
case "2":
|
||||
C = tc.FtoC(Console.ReadLine());break;
|
||||
default:
|
||||
Console.WriteLine("ERROR");break;
|
||||
}
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user