From f6620bd942ad53092f1de6122c93420876e90bff Mon Sep 17 00:00:00 2001 From: Lukasl32 Date: Wed, 6 Nov 2024 10:16:11 +0100 Subject: [PATCH] =?UTF-8?q?#6=20-=20vypracov=C3=A1n=C3=AD=20=C3=BAkolu=200?= =?UTF-8?q?06=20+=20solution=20update=20pro=20#5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../006-app6-analyza-textu.csproj | 11 +++++ IS-Projekty/006-app6-analyza-textu/Program.cs | 44 +++++++++++++++++++ IS-Projekty/CodebaseIS.sln | 12 +++++ 3 files changed, 67 insertions(+) create mode 100644 IS-Projekty/006-app6-analyza-textu/006-app6-analyza-textu.csproj create mode 100644 IS-Projekty/006-app6-analyza-textu/Program.cs diff --git a/IS-Projekty/006-app6-analyza-textu/006-app6-analyza-textu.csproj b/IS-Projekty/006-app6-analyza-textu/006-app6-analyza-textu.csproj new file mode 100644 index 0000000..046b209 --- /dev/null +++ b/IS-Projekty/006-app6-analyza-textu/006-app6-analyza-textu.csproj @@ -0,0 +1,11 @@ + + + + Exe + net9.0 + _006_app6_analyza_textu + enable + enable + + + diff --git a/IS-Projekty/006-app6-analyza-textu/Program.cs b/IS-Projekty/006-app6-analyza-textu/Program.cs new file mode 100644 index 0000000..526f42f --- /dev/null +++ b/IS-Projekty/006-app6-analyza-textu/Program.cs @@ -0,0 +1,44 @@ +namespace _006_app6_analyza_textu; + +internal class Program +{ + static void Main(string[] args) + { + char[] vowels = new char[] { 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z', 'č', 'ď', 'ř', 'š', 'ť', 'ž' }; + char[] constatns = ['a', 'e', 'i', 'o', 'u', 'y', 'á', 'é', 'í', 'ó', 'ú', 'ů', 'ý']; // zkrácená deklarace pole + + string repeate = "a"; + while (repeate.Equals("a")) + { + int vowlCount = 0, constatCount = 0, otherCharCount = 0; + + Console.Clear(); + Console.WriteLine("********************************"); + Console.WriteLine("******** Lukáš Moravec *********"); + + Console.Write("Zadejte větu k analýze: "); + string? text = Console.ReadLine(); + + if (text != null) + { + text = text.ToLower(); + foreach (var item in text) + { + if (vowels.Contains(item)) + vowlCount++; + else if (constatns.Contains(item)) + constatCount++; + else + otherCharCount++; + } + } + + Console.WriteLine("Výsledek analýzy:"); + Console.WriteLine($"Počet souhlásek: {vowlCount}"); + Console.WriteLine($"Počet samohlásek: {constatCount}"); + Console.WriteLine($"Počet ostatních znaků: {otherCharCount}"); + + Console.ReadKey(); + } + } +} diff --git a/IS-Projekty/CodebaseIS.sln b/IS-Projekty/CodebaseIS.sln index e07fb78..073b41b 100644 --- a/IS-Projekty/CodebaseIS.sln +++ b/IS-Projekty/CodebaseIS.sln @@ -22,6 +22,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "004-app4-generator", "004-a EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "003c-app3c-obrazce", "003c-app3c-obrazce\003c-app3c-obrazce.csproj", "{66A4C664-1C9A-4A59-8A8E-1AB9F999DD71}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "005-app5-max-min", "005-app5-max-min\005-app5-max-min.csproj", "{A5F2409B-ECE8-4E50-B69D-1B90232CE713}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "006-app6-analyza-textu", "006-app6-analyza-textu\006-app6-analyza-textu.csproj", "{99AAC9C3-7D6B-48F7-A46B-564DAD28A8E4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -56,6 +60,14 @@ Global {66A4C664-1C9A-4A59-8A8E-1AB9F999DD71}.Debug|Any CPU.Build.0 = Debug|Any CPU {66A4C664-1C9A-4A59-8A8E-1AB9F999DD71}.Release|Any CPU.ActiveCfg = Release|Any CPU {66A4C664-1C9A-4A59-8A8E-1AB9F999DD71}.Release|Any CPU.Build.0 = Release|Any CPU + {A5F2409B-ECE8-4E50-B69D-1B90232CE713}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5F2409B-ECE8-4E50-B69D-1B90232CE713}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5F2409B-ECE8-4E50-B69D-1B90232CE713}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5F2409B-ECE8-4E50-B69D-1B90232CE713}.Release|Any CPU.Build.0 = Release|Any CPU + {99AAC9C3-7D6B-48F7-A46B-564DAD28A8E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99AAC9C3-7D6B-48F7-A46B-564DAD28A8E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {99AAC9C3-7D6B-48F7-A46B-564DAD28A8E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {99AAC9C3-7D6B-48F7-A46B-564DAD28A8E4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE