From 4aeaaee4814542d48e51f8423039e65988ffa900 Mon Sep 17 00:00:00 2001 From: Matikainen Aini Esteri <aini.matikan@gmail.com> Date: Fri, 14 Mar 2025 12:49:55 +0200 Subject: [PATCH] 50% --- "ty\303\266/.DS_Store" | Bin 0 -> 6148 bytes .../.idea/.idea.ty\303\266/.idea/.gitignore" | 13 ++++++ .../.idea.ty\303\266/.idea/indexLayout.xml" | 8 ++++ "ty\303\266/ty\303\266.sln" | 16 +++++++ "ty\303\266/ty\303\266/Program.cs" | 42 ++++++++++++++++++ "ty\303\266/ty\303\266/ty\303\266.csproj" | 10 +++++ 6 files changed, 89 insertions(+) create mode 100644 "ty\303\266/.DS_Store" create mode 100644 "ty\303\266/.idea/.idea.ty\303\266/.idea/.gitignore" create mode 100644 "ty\303\266/.idea/.idea.ty\303\266/.idea/indexLayout.xml" create mode 100644 "ty\303\266/ty\303\266.sln" create mode 100644 "ty\303\266/ty\303\266/Program.cs" create mode 100644 "ty\303\266/ty\303\266/ty\303\266.csproj" diff --git "a/ty\303\266/.DS_Store" "b/ty\303\266/.DS_Store" new file mode 100644 index 0000000000000000000000000000000000000000..8c1b8169533f31c686b9e11cdfc36689259bb7f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mVfW*>~F$)La1`&c2Z~+92NDRQhmQyqH{IgJ)QH7o*`-`1gZQsz; zBBJa2X(iH&$P8|jrG<eh@=k8@kmu=oJRdHXvz6Q?Nh`p68SLjaK?SG)6`%rCfC`LA zfjr1(^ASB0AB74~fpI8c--iM>)?^F%rvt%90C0-38`eHcfW-=6O|~E^FpX9)TGhu8 zt9v_G^17OA!DtuF;Y0JzYEukMqg}KhfoXLxPys41P@s#vxAT7s|2F>*T9{G+D)46t z=ybE&tnpHLwtl>x)%RJob%TR`Il|jd01`Wj7jQT17h8Ze*@CFR_#@ylFi?S?D)0gt CY7!6t literal 0 HcmV?d00001 diff --git "a/ty\303\266/.idea/.idea.ty\303\266/.idea/.gitignore" "b/ty\303\266/.idea/.idea.ty\303\266/.idea/.gitignore" new file mode 100644 index 0000000..fb33b1c --- /dev/null +++ "b/ty\303\266/.idea/.idea.ty\303\266/.idea/.gitignore" @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/contentModel.xml +/.idea.työ.iml +/projectSettingsUpdater.xml +/modules.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git "a/ty\303\266/.idea/.idea.ty\303\266/.idea/indexLayout.xml" "b/ty\303\266/.idea/.idea.ty\303\266/.idea/indexLayout.xml" new file mode 100644 index 0000000..7b08163 --- /dev/null +++ "b/ty\303\266/.idea/.idea.ty\303\266/.idea/indexLayout.xml" @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="UserContentModel"> + <attachedFolders /> + <explicitIncludes /> + <explicitExcludes /> + </component> +</project> \ No newline at end of file diff --git "a/ty\303\266/ty\303\266.sln" "b/ty\303\266/ty\303\266.sln" new file mode 100644 index 0000000..dbba6f3 --- /dev/null +++ "b/ty\303\266/ty\303\266.sln" @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "työ", "työ\työ.csproj", "{B9491394-6387-4496-AEA2-4CB63DE16941}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B9491394-6387-4496-AEA2-4CB63DE16941}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B9491394-6387-4496-AEA2-4CB63DE16941}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B9491394-6387-4496-AEA2-4CB63DE16941}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B9491394-6387-4496-AEA2-4CB63DE16941}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git "a/ty\303\266/ty\303\266/Program.cs" "b/ty\303\266/ty\303\266/Program.cs" new file mode 100644 index 0000000..2a79395 --- /dev/null +++ "b/ty\303\266/ty\303\266/Program.cs" @@ -0,0 +1,42 @@ +using System; + +/// @author ainimatikainen +/// @version 12.3.2025 +/// <summary> +/// Ohjelma, joka laskee tuulen hyytävyyden muuttujien lämpötila, tuulennopeus ja Kosteus avulla, sekä voi hakea tarvittavat säätiedot verkkosivulta +/// </summary> + + +class TuulenHyytavyys +{ + // Tuulenhyytävyyden kaavaan tarvittavat muuttujat (T = lämpötila, V = tuulennopeus, Kosteus) + public static double TuulenHyytavyysKaava(double T, double V, double Kosteus) + { + // Tuulen hyytävyyden kaava = TH + double TH = 13.12 + 0.6215 * T - 11.37 * Math.Pow(V, 0.16) + 0.3965 * Math.Pow(T, 0.16) + (0.05 * Kosteus); + return TH; + } + + // testi että koodi toimii random arvoilla + public static void Main() + { + // satunnaiset arvot muuttujille + double T = 10; // Ilman lämpötila (°C) + double Kosteus = 75; // Kosteusprosentti (%) + + // Viikon tuulen nopeudet (km/h) jokaiselle päivälle + double[] tuulenNopeudet = { 9, 12, 13, 25, 17, 30, 8 }; + // Listataan viikonpäivien nimet + string[] viikonPaivat = { "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai", "Sunnuntai" }; + + // silmukka, joka käy läpi viikonpäivät ja tuulen nopeudet + for (int i = 0; i < viikonPaivat.Length; i++) + { + double V = tuulenNopeudet[i]; // Tuulen nopeus (km/h) i = viikonpäivä + // Kutsutaan kaavaa + double TH = TuulenHyytavyysKaava(T, V, Kosteus); + // Tulostetaan tulos + Console.WriteLine($"{viikonPaivat[i]}: Tuulen hyytävyyden arvo nopeudella {V} km/h on: {TH:F2} °C"); + } + } +} \ No newline at end of file diff --git "a/ty\303\266/ty\303\266/ty\303\266.csproj" "b/ty\303\266/ty\303\266/ty\303\266.csproj" new file mode 100644 index 0000000..2f4fc77 --- /dev/null +++ "b/ty\303\266/ty\303\266/ty\303\266.csproj" @@ -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> -- GitLab