From e2acb271159570281acd8beefc239a1dec0ebfbe Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Mon, 25 Oct 2021 23:59:55 +0300 Subject: [PATCH 1/9] feat: initial commit --- .gitignore | 388 ++++++++++++++++++ Lab1.1Savarankiskas/1Savarankiskas.csproj | 15 + Lab1.1Savarankiskas/InOutUtils.cs | 39 ++ Lab1.1Savarankiskas/Program.cs | 35 ++ Lab1.1Savarankiskas/TaskUtils.cs | 56 +++ Lab1.1Savarankiskas/Tourist.cs | 19 + Lab1.1Savarankiskas/Tourists.csv | 5 + Lab1.Exercises.Register/Dog.cs | 33 ++ Lab1.Exercises.Register/Dogs.csv | 6 + Lab1.Exercises.Register/Gender.cs | 12 + Lab1.Exercises.Register/InOutUtils.cs | 64 +++ .../Lab1.Exercises.Register.csproj | 14 + Lab1.Exercises.Register/Program.cs | 58 +++ Lab1.Exercises.Register/TaskUtils.cs | 99 +++++ Lab1.Exercises.sln | 79 ++++ Lab1.IMDB/Actors.csv | 5 + Lab1.IMDB/InOutUtils.cs | 39 ++ Lab1.IMDB/Lab1.IMDB.csproj | 14 + Lab1.IMDB/Movie.cs | 24 ++ Lab1.IMDB/Movies.csv | 7 + Lab1.IMDB/Program.cs | 33 ++ Lab1.IMDB/TaskUtils.cs | 51 +++ Lab1.TouristInformationCenter/InOutUtils.cs | 113 +++++ .../Lab1.TouristInformationCenter.csproj | 14 + Lab1.TouristInformationCenter/Museum.cs | 26 ++ Lab1.TouristInformationCenter/Museums.csv | 6 + Lab1.TouristInformationCenter/Program.cs | 30 ++ Lab1.TouristInformationCenter/TaskUtils.cs | 66 +++ Lab1.TouristInformationCenter/Weekday.cs | 17 + README.md | 6 + 30 files changed, 1373 insertions(+) create mode 100644 .gitignore create mode 100644 Lab1.1Savarankiskas/1Savarankiskas.csproj create mode 100644 Lab1.1Savarankiskas/InOutUtils.cs create mode 100644 Lab1.1Savarankiskas/Program.cs create mode 100644 Lab1.1Savarankiskas/TaskUtils.cs create mode 100644 Lab1.1Savarankiskas/Tourist.cs create mode 100644 Lab1.1Savarankiskas/Tourists.csv create mode 100644 Lab1.Exercises.Register/Dog.cs create mode 100644 Lab1.Exercises.Register/Dogs.csv create mode 100644 Lab1.Exercises.Register/Gender.cs create mode 100644 Lab1.Exercises.Register/InOutUtils.cs create mode 100644 Lab1.Exercises.Register/Lab1.Exercises.Register.csproj create mode 100644 Lab1.Exercises.Register/Program.cs create mode 100644 Lab1.Exercises.Register/TaskUtils.cs create mode 100644 Lab1.Exercises.sln create mode 100644 Lab1.IMDB/Actors.csv create mode 100644 Lab1.IMDB/InOutUtils.cs create mode 100644 Lab1.IMDB/Lab1.IMDB.csproj create mode 100644 Lab1.IMDB/Movie.cs create mode 100644 Lab1.IMDB/Movies.csv create mode 100644 Lab1.IMDB/Program.cs create mode 100644 Lab1.IMDB/TaskUtils.cs create mode 100755 Lab1.TouristInformationCenter/InOutUtils.cs create mode 100755 Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj create mode 100755 Lab1.TouristInformationCenter/Museum.cs create mode 100755 Lab1.TouristInformationCenter/Museums.csv create mode 100755 Lab1.TouristInformationCenter/Program.cs create mode 100755 Lab1.TouristInformationCenter/TaskUtils.cs create mode 100755 Lab1.TouristInformationCenter/Weekday.cs create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26ab8f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,388 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Nuget personal access tokens and Credentials +# nuget.config + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +.idea/ +*.sln.iml diff --git a/Lab1.1Savarankiskas/1Savarankiskas.csproj b/Lab1.1Savarankiskas/1Savarankiskas.csproj new file mode 100644 index 0000000..026b680 --- /dev/null +++ b/Lab1.1Savarankiskas/1Savarankiskas.csproj @@ -0,0 +1,15 @@ + + + + Exe + net461 + Lab1._1Savarankiskas + + + + + PreserveNewest + + + + diff --git a/Lab1.1Savarankiskas/InOutUtils.cs b/Lab1.1Savarankiskas/InOutUtils.cs new file mode 100644 index 0000000..7ca1f86 --- /dev/null +++ b/Lab1.1Savarankiskas/InOutUtils.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace Lab1._1Savarankiskas +{ + class InOutUtils + { + public static List ReadTourists(string fileName) + { + List tourists = new List(); + string[] lines = File.ReadAllLines(fileName, Encoding.UTF8); + foreach (string line in lines) + { + string[] values = line.Split(";"); + string name = values[0]; + string surname = values[1]; + double money = double.Parse(values[2]); + Tourist tourist = new Tourist(name, surname, money); + tourists.Add(tourist); + } + return tourists; + } + + public static void PrintTourists(List tourists) + { + Console.WriteLine(new string('-', 47)); + Console.WriteLine("| {0,-12} | {1,-12} | {2,-13} |", "Vardas", "Pavardė", "Pinigai"); + Console.WriteLine(new string('-', 47)); + foreach (Tourist tourist in tourists) + { + Console.WriteLine("| {0,-12} | {1,-12} | {2,-13:c2} |", tourist.Name, tourist.Surname, tourist.Money); + } + Console.WriteLine(new string('-', 47)); + } + } +} + diff --git a/Lab1.1Savarankiskas/Program.cs b/Lab1.1Savarankiskas/Program.cs new file mode 100644 index 0000000..628ab68 --- /dev/null +++ b/Lab1.1Savarankiskas/Program.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; + +namespace Lab1._1Savarankiskas +{ + class Program + { + static void Main(string[] args) + { + List tourists = InOutUtils.ReadTourists("Tourists.csv"); + InOutUtils.PrintTourists(tourists); + + double spendingBudget = TaskUtils.GetBudget(tourists); + Console.WriteLine("Grupės išlaidų biudžetas: {0:c2}", spendingBudget); + Console.WriteLine(); + + List largestContributors = TaskUtils.GetLargestBudgetContributors(tourists); + if (largestContributors.Count > 0) + { + if (largestContributors.Count == 1) + { + Console.WriteLine("Turistas kuris daugiausiai prisidėjo prie išlaidų biudžeto:"); + } + else + { + Console.WriteLine("Turistai kurie daugiausiai prisidėjo prie išlaidų biudžeto:"); + } + foreach (Tourist tourist in largestContributors) + { + Console.WriteLine("{0} {1}", tourist.Name, tourist.Surname); + } + } + } + } +} diff --git a/Lab1.1Savarankiskas/TaskUtils.cs b/Lab1.1Savarankiskas/TaskUtils.cs new file mode 100644 index 0000000..80b6195 --- /dev/null +++ b/Lab1.1Savarankiskas/TaskUtils.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Lab1._1Savarankiskas +{ + class TaskUtils + { + public static double GetBudget(List tourists) + { + double spendingBudget = 0; + foreach (Tourist tourist in tourists) + { + spendingBudget += tourist.Money; + } + spendingBudget *= 0.3; + return spendingBudget; + } + + public static Tourist GetLargestBudgetContributor(List tourists) + { + if (tourists.Count == 0) + { + return null; + } + + Tourist largestContributor = tourists[0]; + foreach (Tourist tourist in tourists) + { + if (tourist.Money > largestContributor.Money) + { + largestContributor = tourist; + } + } + return largestContributor; + } + + public static List GetLargestBudgetContributors(List tourists) { + List largestContributors = new List(); + Tourist largestContributor = GetLargestBudgetContributor(tourists); + if (largestContributor == null) + { + return largestContributors; + } + + foreach (Tourist tourist in tourists) + { + if (tourist.Money == largestContributor.Money) + { + largestContributors.Add(tourist); + } + } + return largestContributors; + } + } +} diff --git a/Lab1.1Savarankiskas/Tourist.cs b/Lab1.1Savarankiskas/Tourist.cs new file mode 100644 index 0000000..711f26e --- /dev/null +++ b/Lab1.1Savarankiskas/Tourist.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Lab1._1Savarankiskas +{ + class Tourist + { + public string Name { get; set; } + public string Surname { get; set; } + public double Money { get; set; } + public Tourist(string name, string surname, double money) + { + Name = name; + Surname = surname; + Money = money; + } + } +} diff --git a/Lab1.1Savarankiskas/Tourists.csv b/Lab1.1Savarankiskas/Tourists.csv new file mode 100644 index 0000000..8d22647 --- /dev/null +++ b/Lab1.1Savarankiskas/Tourists.csv @@ -0,0 +1,5 @@ +Jonas;Jonaitis;100 +Rokas;Jonaitis;150 +Petras;Jonaitis;81 +Ona;Jonaitis;69 +Mantas;Jonaitis;150 diff --git a/Lab1.Exercises.Register/Dog.cs b/Lab1.Exercises.Register/Dog.cs new file mode 100644 index 0000000..a68eae1 --- /dev/null +++ b/Lab1.Exercises.Register/Dog.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Lab1.Exercises.Register +{ + class Dog + { + public int ID { get; set; } + public string Name { get; set; } + public string Breed { get; set; } + public DateTime BirthDate { get; set; } + public Gender Gender { get; set; } + public Dog(int id, string name, string breed, DateTime birthDate, Gender gender) + { + ID = id; + Name = name; + Breed = breed; + BirthDate = birthDate; + Gender = gender; + } + public int CalculateAge() + { + DateTime today = DateTime.Today; + int age = today.Year - BirthDate.Year; + if (BirthDate.Date > today.AddYears(-age)) + { + age--; + } + return age; + } + } +} diff --git a/Lab1.Exercises.Register/Dogs.csv b/Lab1.Exercises.Register/Dogs.csv new file mode 100644 index 0000000..f9070b5 --- /dev/null +++ b/Lab1.Exercises.Register/Dogs.csv @@ -0,0 +1,6 @@ +123;Reksas;Buldogas;2014-01-01;Male +124;Margis;Dalmantinas;2014-02-28;Male +125;Bitė;Senbernaras;2008-07-17;Female +320;Rikis;Taksas;2012-01-07;Male +415;Pifas;Taksas;2014-07-07;Male +420;Markas;Dalmantinas;2013-02-28;Female \ No newline at end of file diff --git a/Lab1.Exercises.Register/Gender.cs b/Lab1.Exercises.Register/Gender.cs new file mode 100644 index 0000000..3725214 --- /dev/null +++ b/Lab1.Exercises.Register/Gender.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Lab1.Exercises.Register +{ + enum Gender + { + Male = 1, + Female = 2, + } +} diff --git a/Lab1.Exercises.Register/InOutUtils.cs b/Lab1.Exercises.Register/InOutUtils.cs new file mode 100644 index 0000000..3be9e02 --- /dev/null +++ b/Lab1.Exercises.Register/InOutUtils.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Lab1.Exercises.Register +{ + class InOutUtils + { + public static List ReadDogs(string fileName) + { + List Dogs = new List(); + string[] Lines = File.ReadAllLines(fileName, Encoding.UTF8); + foreach (string line in Lines) + { + string[] Values = line.Split(';'); + int id = int.Parse(Values[0]); + string name = Values[1]; + string breed = Values[2]; + DateTime birthDate = DateTime.Parse(Values[3]); + Gender gender; + Enum.TryParse(Values[4], out gender); //tries to convert value to enum + Dog dog = new Dog(id, name, breed, birthDate, gender); + Dogs.Add(dog); + } + return Dogs; + } + public static void PrintDogs(List Dogs) + { + Console.WriteLine(new string('-', 74)); + Console.WriteLine("| {0,8} | {1,-15} | {2,-15} | {3,-12} | {4,-8} |", "Reg.Nr.", "Vardas", "Veislė", "Gimimo data", "Lytis"); + Console.WriteLine(new string('-', 74)); + foreach (Dog dog in Dogs) + { + Console.WriteLine("| {0,8} | {1,-15} | {2,-15} | {3,-12:yyyy-MM-dd} | {4,-8} |", dog.ID, dog.Name, dog.Breed, dog.BirthDate, dog.Gender); + } + Console.WriteLine(new string('-', 74)); + } + + public static void PrintDog(Dog dog) + { + Console.WriteLine("Vardas: {0}, Veislė: {1}, Amžius: {2}", dog.Name, dog.Breed, dog.CalculateAge()); + } + + public static void PrintBreeds(List breeds) + { + foreach (string breed in breeds) + { + Console.WriteLine(breed); + } + } + + public static void PrintDogsToCSVFile(string fileName, List Dogs) + { + string[] lines = new string[Dogs.Count + 1]; + lines[0] = String.Format("{0};{1};{2};{3};{4}", "Reg.Nr.", "Vardas", "Veislė", "Gimimo data", "Lytis"); + for (int i = 0; i < Dogs.Count; i++) + { + lines[i + 1] = String.Format("{0};{1};{2};{3};{4}", Dogs[i].ID, Dogs[i].Name, Dogs[i].Breed, Dogs[i].BirthDate, Dogs[i].Gender); + } + File.WriteAllLines(fileName, lines, Encoding.UTF8); + } + } +} diff --git a/Lab1.Exercises.Register/Lab1.Exercises.Register.csproj b/Lab1.Exercises.Register/Lab1.Exercises.Register.csproj new file mode 100644 index 0000000..2e6dfb4 --- /dev/null +++ b/Lab1.Exercises.Register/Lab1.Exercises.Register.csproj @@ -0,0 +1,14 @@ + + + + Exe + netcoreapp2.1 + + + + + PreserveNewest + + + + diff --git a/Lab1.Exercises.Register/Program.cs b/Lab1.Exercises.Register/Program.cs new file mode 100644 index 0000000..219ef12 --- /dev/null +++ b/Lab1.Exercises.Register/Program.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; + +namespace Lab1.Exercises.Register +{ + class Program + { + static void Main(string[] args) + { + List allDogs = InOutUtils.ReadDogs("Dogs.csv"); + Console.WriteLine("Registro informacija:"); + InOutUtils.PrintDogs(allDogs); + + Console.WriteLine("Iš viso šunų: {0}", allDogs.Count); + Console.WriteLine("Patinų: {0}", TaskUtils.CountByGender(allDogs, Gender.Male)); + Console.WriteLine("Patelių: {0}", TaskUtils.CountByGender(allDogs, Gender.Female)); + Console.WriteLine(); + + Dog oldestDog = TaskUtils.FindOldestDog(allDogs); + Console.WriteLine("Seniausias šuo:"); + InOutUtils.PrintDog(oldestDog); + Console.WriteLine(); + + List breeds = TaskUtils.FindBreeds(allDogs); + Console.WriteLine("Šunų veislės:"); + InOutUtils.PrintBreeds(breeds); + Console.WriteLine(); + + List popularBreeds = TaskUtils.FindMostPopularBreeds(allDogs); + Console.WriteLine("Populiariausios šunų veislės:"); + InOutUtils.PrintBreeds(popularBreeds); + Console.WriteLine(); + + Console.WriteLine("Kokios veislės šunis atrinkti?"); + string selectedBreed = Console.ReadLine().Trim(); + if (selectedBreed.Equals("")) + { + Console.WriteLine("Šunio veislė neįvesta"); + return; + } + + List filteredByBreed = TaskUtils.FilterByBreed(allDogs, selectedBreed); + if (filteredByBreed.Count == 0) + { + Console.WriteLine("Šunų su veisle '{0}' nerasta", selectedBreed); + return; + } + + Dog oldestFilteredDog = TaskUtils.FindOldestDog(filteredByBreed); + Console.WriteLine("Seniausias šuo pagal '{0}' veislę:", selectedBreed); + InOutUtils.PrintDog(oldestFilteredDog); + InOutUtils.PrintDogs(filteredByBreed); + string fileName = selectedBreed + ".csv"; + InOutUtils.PrintDogsToCSVFile(fileName, filteredByBreed); + + } + } +} diff --git a/Lab1.Exercises.Register/TaskUtils.cs b/Lab1.Exercises.Register/TaskUtils.cs new file mode 100644 index 0000000..befb030 --- /dev/null +++ b/Lab1.Exercises.Register/TaskUtils.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Lab1.Exercises.Register +{ + class TaskUtils + { + public static int CountByGender(List dogs, Gender gender) + { + int count = 0; + foreach (Dog dog in dogs) + { + if (dog.Gender.Equals(gender)) + { + count++; + } + } + return count; + } + public static Dog FindOldestDog(List dogs) + { + Dog oldest = dogs[0]; // means least value + for (int i = 1; i < dogs.Count; i++) + { + if (DateTime.Compare(dogs[i].BirthDate, oldest.BirthDate) < 0) + { + oldest = dogs[i]; + } + } + return oldest; + } + public static List FindBreeds(List dogs) + { + List Breeds = new List(); + foreach (Dog dog in dogs) + { + string breed = dog.Breed; + if (!Breeds.Contains(breed)) // uses List method Contains() + { + Breeds.Add(breed); + } + } + return Breeds; + } + + public static List FilterByBreed(List dogs, string breed) + { + List Filtered = new List(); + foreach (Dog dog in dogs) + { + if (dog.Breed.Equals(breed)) // uses string method Equals() + { + Filtered.Add(dog); + } + } + return Filtered; + } + + public static int CountByBreed(List dogs, string breed) + { + int count = 0; + foreach (Dog dog in dogs) + { + if (dog.Breed.Equals(breed)) // uses string method Equals() + { + count++; + } + } + return count; + } + + public static List FindMostPopularBreeds(List dogs) + { + List breeds = FindBreeds(dogs); + int mostPopularCount = CountByBreed(dogs, breeds[0]); + foreach (string breed in breeds) + { + int count = CountByBreed(dogs, breed); + if (count > mostPopularCount) + { + mostPopularCount = count; + } + } + + List popularBreeds = new List(); + foreach (string breed in breeds) + { + if (CountByBreed(dogs, breed) == mostPopularCount) + { + popularBreeds.Add(breed); + } + } + + return popularBreeds; + } + + } +} diff --git a/Lab1.Exercises.sln b/Lab1.Exercises.sln new file mode 100644 index 0000000..782ff1c --- /dev/null +++ b/Lab1.Exercises.sln @@ -0,0 +1,79 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.1525 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "1Savarankiskas", "Lab1.1Savarankiskas\1Savarankiskas.csproj", "{D07BFD15-69E6-4D59-866D-CEB9730B1DF5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lab1.Exercises.Register", "Lab1.Exercises.Register\Lab1.Exercises.Register.csproj", "{2EEB9341-1B3B-41F0-B22A-762984B255B0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lab1.IMDB", "Lab1.IMDB\Lab1.IMDB.csproj", "{FA4EC695-560B-43F8-A864-ADC843A91D65}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lab1.TouristInformationCenter", "Lab1.TouristInformationCenter\Lab1.TouristInformationCenter.csproj", "{7E583A11-4139-40AA-89C6-E5CAE0F27AD5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Debug|x64.ActiveCfg = Debug|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Debug|x64.Build.0 = Debug|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Debug|x86.ActiveCfg = Debug|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Debug|x86.Build.0 = Debug|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Release|Any CPU.Build.0 = Release|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Release|x64.ActiveCfg = Release|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Release|x64.Build.0 = Release|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Release|x86.ActiveCfg = Release|Any CPU + {D07BFD15-69E6-4D59-866D-CEB9730B1DF5}.Release|x86.Build.0 = Release|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Debug|x64.ActiveCfg = Debug|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Debug|x64.Build.0 = Debug|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Debug|x86.ActiveCfg = Debug|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Debug|x86.Build.0 = Debug|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Release|Any CPU.Build.0 = Release|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Release|x64.ActiveCfg = Release|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Release|x64.Build.0 = Release|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Release|x86.ActiveCfg = Release|Any CPU + {2EEB9341-1B3B-41F0-B22A-762984B255B0}.Release|x86.Build.0 = Release|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Debug|x64.ActiveCfg = Debug|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Debug|x64.Build.0 = Debug|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Debug|x86.ActiveCfg = Debug|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Debug|x86.Build.0 = Debug|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Release|Any CPU.Build.0 = Release|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Release|x64.ActiveCfg = Release|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Release|x64.Build.0 = Release|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Release|x86.ActiveCfg = Release|Any CPU + {FA4EC695-560B-43F8-A864-ADC843A91D65}.Release|x86.Build.0 = Release|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Debug|x64.ActiveCfg = Debug|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Debug|x64.Build.0 = Debug|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Debug|x86.ActiveCfg = Debug|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Debug|x86.Build.0 = Debug|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Release|Any CPU.Build.0 = Release|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Release|x64.ActiveCfg = Release|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Release|x64.Build.0 = Release|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Release|x86.ActiveCfg = Release|Any CPU + {7E583A11-4139-40AA-89C6-E5CAE0F27AD5}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {03AFC156-496A-4000-9EFE-0E6803C9EC9A} + EndGlobalSection +EndGlobal diff --git a/Lab1.IMDB/Actors.csv b/Lab1.IMDB/Actors.csv new file mode 100644 index 0000000..53eb0ad --- /dev/null +++ b/Lab1.IMDB/Actors.csv @@ -0,0 +1,5 @@ +T. Cruise +Tiesiog Petras +Kaimynas Rokas +N. Kidman +Tiesiog Jonas diff --git a/Lab1.IMDB/InOutUtils.cs b/Lab1.IMDB/InOutUtils.cs new file mode 100644 index 0000000..57866cf --- /dev/null +++ b/Lab1.IMDB/InOutUtils.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Lab1.IMDB +{ + class InOutUtils + { + public static List ReadMovies(string filename) + { + List movies = new List(); + string[] lines = File.ReadAllLines(filename, Encoding.UTF8); + foreach (string line in lines) + { + string[] values = line.Split(';'); + string title = values[0]; + int year = int.Parse(values[1]); + string genre = values[2]; + string studio = values[3]; + string producer = values[4]; + string actor1 = values[5]; + string actor2 = values[6]; + Movie movie = new Movie(title, year, genre, studio, producer, actor1, actor2); + movies.Add(movie); + } + return movies; + } + + public static void WriteActors(string filename, List actors) + { + string[] lines = new string[actors.Count]; + for (int i = 0; i < actors.Count; i++) + { + lines[i] = actors[i]; + } + File.WriteAllLines(filename, lines, Encoding.UTF8); + } + } +} diff --git a/Lab1.IMDB/Lab1.IMDB.csproj b/Lab1.IMDB/Lab1.IMDB.csproj new file mode 100644 index 0000000..c32a44f --- /dev/null +++ b/Lab1.IMDB/Lab1.IMDB.csproj @@ -0,0 +1,14 @@ + + + + Exe + net461 + + + + + PreserveNewest + + + + diff --git a/Lab1.IMDB/Movie.cs b/Lab1.IMDB/Movie.cs new file mode 100644 index 0000000..0d0a33c --- /dev/null +++ b/Lab1.IMDB/Movie.cs @@ -0,0 +1,24 @@ + +namespace Lab1.IMDB +{ + class Movie + { + public string Title { get; set; } + public int Year { get; set; } + public string Genre { get; set; } + public string Studio { get; set; } + public string Producer { get; set; } + public string Actor1 { get; set; } + public string Actor2 { get; set; } + public Movie(string title, int year, string genre, string studio, string producer, string actor1, string actor2) { + Title = title; + Year = year; + Genre = genre; + Studio = studio; + Producer = producer; + Actor1 = actor1; + Actor2 = actor2; + } + } +} + diff --git a/Lab1.IMDB/Movies.csv b/Lab1.IMDB/Movies.csv new file mode 100644 index 0000000..503f96e --- /dev/null +++ b/Lab1.IMDB/Movies.csv @@ -0,0 +1,7 @@ +MovieA;2020;FooBar;Warner Bros;Jonaitis jonas;T. Cruise;Tiesiog Petras +MovieB;2010;FooBar;Mano Bros;Kaimyne Ona;Tiesiog Petras;Kaimynas Rokas +MovieC;2024;FooBar;Mano Bros;Jonaitis jonas;T. Cruise;Tiesiog Petras +MovieD;1020;FooBar;Warner Bros;Jonaitis jonas;T. Cruise;N. Kidman +MovieE;2012;FooBar;Warner Bros;Jonaitis kasparas;T. Cruise;Tiesiog Petras +MovieF;2110;FooBar;Tavo Bros;Jonaitis petras;Tiesiog Petras;Tiesiog Jonas +MovieG;2120;FooBar;Tavo Bros;Jonaitis jonas;N. Kidman;T. Cruise diff --git a/Lab1.IMDB/Program.cs b/Lab1.IMDB/Program.cs new file mode 100644 index 0000000..21d6cb4 --- /dev/null +++ b/Lab1.IMDB/Program.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; + +// Variant U1-21. +namespace Lab1.IMDB +{ + class Program + { + static void Main(string[] args) + { + List movies = InOutUtils.ReadMovies("Movies.csv"); + + List filteredByActors = TaskUtils.FilterByActors(movies, "T. Cruise", "N. Kidman"); + Console.WriteLine("Movies with T. Cruise and N. Kidman:"); + foreach (Movie movie in filteredByActors) + { + Console.WriteLine("{0} {1}", movie.Title, movie.Year); + } + Console.WriteLine(); + + + List filteredByStudio = TaskUtils.FilterByStudio(movies, "Warner Bros"); + Console.WriteLine("Movies by Warner Bros:"); + foreach (Movie movie in filteredByStudio) + { + Console.WriteLine("{0} {1}", movie.Title, movie.Year); + } + + List actors = TaskUtils.GetActors(movies); + InOutUtils.WriteActors("Actors.csv", actors); + } + } +} diff --git a/Lab1.IMDB/TaskUtils.cs b/Lab1.IMDB/TaskUtils.cs new file mode 100644 index 0000000..59e9c44 --- /dev/null +++ b/Lab1.IMDB/TaskUtils.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using System; + +namespace Lab1.IMDB +{ + class TaskUtils + { + public static List FilterByActors(List movies, string actor1, string actor2) + { + List filtered = new List(); + foreach (Movie movie in movies) + { + if (movie.Actor1 == actor1 && movie.Actor2 == actor2 || movie.Actor1 == actor2 && movie.Actor2 == actor1) + { + filtered.Add(movie); + } + } + return filtered; + } + + public static List FilterByStudio(List movies, string studio) + { + List filtered = new List(); + foreach (Movie movie in movies) + { + if (movie.Studio.Equals(studio)) + { + filtered.Add(movie); + } + } + return filtered; + } + + public static List GetActors(List movies) + { + List actors = new List(); + foreach (Movie movie in movies) + { + if (!actors.Contains(movie.Actor1)) + { + actors.Add(movie.Actor1); + } + if (!actors.Contains(movie.Actor2)) + { + actors.Add(movie.Actor2); + } + } + return actors; + } + } +} diff --git a/Lab1.TouristInformationCenter/InOutUtils.cs b/Lab1.TouristInformationCenter/InOutUtils.cs new file mode 100755 index 0000000..9a282a4 --- /dev/null +++ b/Lab1.TouristInformationCenter/InOutUtils.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace Lab1.TouristInformationCenter +{ + /// + /// Class that stores functions that are related to reading and writing data + /// + class InOutUtils + { + /// + /// Read and decode a list of museums from a file. The file must be in a csv format using ";" as seperators. + /// + /// Target file + /// List of museums + public static List ReadMuseums(string filename) + { + List museums = new List(); + string[] lines = File.ReadAllLines(filename, Encoding.UTF8); + foreach (string line in lines) + { + string[] values = line.Split(';'); + string name = values[0]; + string city = values[1]; + string type = values[2]; + List workdays = new List(); + if (int.Parse(values[3]) == 1) + { + workdays.Add(Weekday.Monday); + } + if (int.Parse(values[4]) == 1) + { + workdays.Add(Weekday.Tuesday); + } + if (int.Parse(values[5]) == 1) + { + workdays.Add(Weekday.Wednesday); + } + if (int.Parse(values[6]) == 1) + { + workdays.Add(Weekday.Thursday); + } + if (int.Parse(values[7]) == 1) + { + workdays.Add(Weekday.Friday); + } + if (int.Parse(values[8]) == 1) + { + workdays.Add(Weekday.Saturday); + } + if (int.Parse(values[9]) == 1) + { + workdays.Add(Weekday.Sunday); + } + double price = double.Parse(values[10]); + bool hasGuide = int.Parse(values[11]) == 1; + + Museum museum = new Museum(name, city, type, workdays, price, hasGuide); + museums.Add(museum); + } + return museums; + } + + /// + /// Write and encodes a list of museums to a file. The file will be in a csv format using ";" as seperators. + /// + /// Target file + /// List of museums + public static void WriteMuseums(string filename, List museums) + { + string[] lines = new string[museums.Count]; + for (int i = 0; i < museums.Count; i++) + { + Museum m = museums[i]; + string workDays = ""; + workDays += m.Workdays.Contains(Weekday.Monday) ? "1" : "0"; + workDays += m.Workdays.Contains(Weekday.Tuesday) ? ";1" : ";0"; + workDays += m.Workdays.Contains(Weekday.Wednesday) ? ";1" : ";0"; + workDays += m.Workdays.Contains(Weekday.Thursday) ? ";1" : ";0"; + workDays += m.Workdays.Contains(Weekday.Friday) ? ";1" : ";0"; + workDays += m.Workdays.Contains(Weekday.Saturday) ? ";1" : ";0"; + workDays += m.Workdays.Contains(Weekday.Sunday) ? ";1" : ";0"; + + lines[i] = String.Join(";", m.Name, m.City, m.Type, workDays, m.Price, m.HasGuide ? '1' : '0'); + } + File.WriteAllLines(filename, lines, Encoding.UTF8); + } + + /// + /// Write out a list of museums in a table to the console. + /// + /// List of museums + public static void PrintMuseums(List museums) + { + if (museums.Count == 0) + { + Console.WriteLine("Nėra"); + return; + } + + Console.WriteLine(new string('-', 97)); + Console.WriteLine("| {0,20} | {1,-15} | {2,-10} | {3,-18} | {4,-3} | {5,-4} |", "Vardas", "Miestas", "Tipas", "Darbo dienų kiekis", "Kaina", "Turi gidą?"); + Console.WriteLine(new string('-', 97)); + foreach (Museum m in museums) + { + Console.WriteLine("| {0,20} | {1,-15} | {2,-10} | {3,-18} | {4,-5:f2} | {5,-10} |", m.Name, m.City, m.Type, m.Workdays.Count, m.Price, m.HasGuide ? "Taip" : "Ne"); + } + Console.WriteLine(new string('-', 97)); + } + } +} diff --git a/Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj b/Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj new file mode 100755 index 0000000..11d201f --- /dev/null +++ b/Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj @@ -0,0 +1,14 @@ + + + + Exe + netcoreapp2.1 + + + + + PreserveNewest + + + + diff --git a/Lab1.TouristInformationCenter/Museum.cs b/Lab1.TouristInformationCenter/Museum.cs new file mode 100755 index 0000000..eec083a --- /dev/null +++ b/Lab1.TouristInformationCenter/Museum.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; + +namespace Lab1.TouristInformationCenter +{ + /// + /// Class used for storing data related a single museum. + /// + class Museum + { + public string Name { get; set; } + public string City { get; set; } + public string Type { get; set; } + public List Workdays { get; set; } + public double Price { get; set; } + public bool HasGuide { get; set; } + public Museum(string name, string city, string type, List workdays, double price, bool hasGuide) + { + Name = name; + City = city; + Type = type; + Workdays = workdays; + Price = price; + HasGuide = hasGuide; + } + } +} diff --git a/Lab1.TouristInformationCenter/Museums.csv b/Lab1.TouristInformationCenter/Museums.csv new file mode 100755 index 0000000..684dff6 --- /dev/null +++ b/Lab1.TouristInformationCenter/Museums.csv @@ -0,0 +1,6 @@ +VilnausMuziejus;Vilnius;History;1;1;0;1;1;0;0;5,49;0 +KaunoMuziejus;Kaunas;Computer;1;1;0;1;1;1;1;4,69;1 +ŠiauliųMuziejus;Šiauliai;History;0;1;1;1;1;0;0;1,23;1 +MarijampolėsMuziejus;Marijampolė;Food;1;1;1;1;1;1;1;6,90;1 +AlytausMuziejus;Alytus;History;0;1;0;1;1;0;1;10,49;0 +KlaipėdosMuziejus;Klaipėda;Space;1;1;0;1;0;0;0;1,00;0 \ No newline at end of file diff --git a/Lab1.TouristInformationCenter/Program.cs b/Lab1.TouristInformationCenter/Program.cs new file mode 100755 index 0000000..d528e8e --- /dev/null +++ b/Lab1.TouristInformationCenter/Program.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; + +namespace Lab1.TouristInformationCenter +{ + class Program + { + static void Main(string[] args) + { + // Read all museums from initial data file. + List museums = InOutUtils.ReadMuseums("Museums.csv"); + Console.WriteLine("Visi muziejai:"); + InOutUtils.PrintMuseums(museums); + Console.WriteLine(); + + // Filter out museums that are free and a guide. And output those museums to the console. + Console.WriteLine("Muziejai kurie yra nemokami ir turi gidą:"); + InOutUtils.PrintMuseums(TaskUtils.FilterByFreeAndWithGuide(museums)); + Console.WriteLine(); + + // Filter out museums that are "active". And output those museums to the console. + Console.WriteLine("Muziejai kurie dirba bent 5 kartus per savaitę:"); + InOutUtils.PrintMuseums(TaskUtils.FilterByActiveMuseums(museums)); + Console.WriteLine(); + + // Filter out museums that are from "non-popular" cities. And save them to a file. + InOutUtils.WriteMuseums("Atrinkti.csv", TaskUtils.FilterByNonPopularCity(museums)); + } + } +} diff --git a/Lab1.TouristInformationCenter/TaskUtils.cs b/Lab1.TouristInformationCenter/TaskUtils.cs new file mode 100755 index 0000000..981ef6a --- /dev/null +++ b/Lab1.TouristInformationCenter/TaskUtils.cs @@ -0,0 +1,66 @@ +using System.Collections.Generic; + +namespace Lab1.TouristInformationCenter +{ + /// + /// Class used for storing functions that manipulate or filter data. + /// + class TaskUtils + { + /// + /// Return a sub-list of given museums where all museums in the returned list are free and have a guide. + /// + /// List of museums + /// Filtered sub-list of museums + public static List FilterByFreeAndWithGuide(List museums) + { + List filtered = new List(); + foreach (Museum museum in museums) + { + if (museum.HasGuide && museum.Price == 0) + { + filtered.Add(museum); + } + } + return filtered; + } + + /// + /// Return a sub-list of given museums where all museums in the returned list are "active". + /// A museum is considered active if it is working at least 5 times a week. + /// + /// List of museums + /// Filtered sub-list of museums + public static List FilterByActiveMuseums(List museums) + { + List filtered = new List(); + foreach (Museum museum in museums) + { + if (museum.Workdays.Count >= 5) + { + filtered.Add(museum); + } + } + return filtered; + } + + /// + /// Return a sub-list of given museums where all museums in the returned list are from "non-popular" cities. + /// A city is "non-popular" if it is not "Vilnius", "Kaunas" or "Klaipėda". + /// + /// List of museums + /// Filtered sub-list of museums + public static List FilterByNonPopularCity(List museums) + { + List filtered = new List(); + foreach (Museum museum in museums) + { + if (!(museum.City.Equals("Vilnius") || museum.City.Equals("Kaunas") || museum.City.Equals("Klaipėda"))) + { + filtered.Add(museum); + } + } + return filtered; + } + } +} diff --git a/Lab1.TouristInformationCenter/Weekday.cs b/Lab1.TouristInformationCenter/Weekday.cs new file mode 100755 index 0000000..59c6ee9 --- /dev/null +++ b/Lab1.TouristInformationCenter/Weekday.cs @@ -0,0 +1,17 @@ + +namespace Lab1.TouristInformationCenter +{ + /// + /// Used for storing weekdays as numbers rather than strings + /// + enum Weekday + { + Monday = 1, + Tuesday = 2, + Wednesday = 3, + Thursday = 4, + Friday = 5, + Saturday = 6, + Sunday = 7 + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1c6b40 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Introduction example project + +This project is from the "Object oriented programming" course in KTU. + +It is not polished in any way, so don't expect anything from this. + From 22e8a68071dcfa4079b503bb2f5db3c9819ecc62 Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Tue, 26 Oct 2021 20:17:54 +0300 Subject: [PATCH 2/9] docs: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1c6b40..baae3e9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Introduction example project +# Lab1 example project This project is from the "Object oriented programming" course in KTU. From d0f2e780f85a923be9e5279b1e11a9d0ecf9c444 Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Sun, 14 Nov 2021 01:44:34 +0200 Subject: [PATCH 3/9] fix: update owner of file --- Lab1.TouristInformationCenter/InOutUtils.cs | 0 .../Lab1.TouristInformationCenter.csproj | 0 Lab1.TouristInformationCenter/Museum.cs | 0 Lab1.TouristInformationCenter/Museums.csv | 0 Lab1.TouristInformationCenter/Program.cs | 0 Lab1.TouristInformationCenter/TaskUtils.cs | 0 Lab1.TouristInformationCenter/Weekday.cs | 0 7 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 Lab1.TouristInformationCenter/InOutUtils.cs mode change 100755 => 100644 Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj mode change 100755 => 100644 Lab1.TouristInformationCenter/Museum.cs mode change 100755 => 100644 Lab1.TouristInformationCenter/Museums.csv mode change 100755 => 100644 Lab1.TouristInformationCenter/Program.cs mode change 100755 => 100644 Lab1.TouristInformationCenter/TaskUtils.cs mode change 100755 => 100644 Lab1.TouristInformationCenter/Weekday.cs diff --git a/Lab1.TouristInformationCenter/InOutUtils.cs b/Lab1.TouristInformationCenter/InOutUtils.cs old mode 100755 new mode 100644 diff --git a/Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj b/Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj old mode 100755 new mode 100644 diff --git a/Lab1.TouristInformationCenter/Museum.cs b/Lab1.TouristInformationCenter/Museum.cs old mode 100755 new mode 100644 diff --git a/Lab1.TouristInformationCenter/Museums.csv b/Lab1.TouristInformationCenter/Museums.csv old mode 100755 new mode 100644 diff --git a/Lab1.TouristInformationCenter/Program.cs b/Lab1.TouristInformationCenter/Program.cs old mode 100755 new mode 100644 diff --git a/Lab1.TouristInformationCenter/TaskUtils.cs b/Lab1.TouristInformationCenter/TaskUtils.cs old mode 100755 new mode 100644 diff --git a/Lab1.TouristInformationCenter/Weekday.cs b/Lab1.TouristInformationCenter/Weekday.cs old mode 100755 new mode 100644 From 6be5af22d9df86f3b379fe191742fe657b22bf81 Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Wed, 17 Nov 2021 01:42:47 +0200 Subject: [PATCH 4/9] fix: update output formatting --- Lab1.TouristInformationCenter/InOutUtils.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lab1.TouristInformationCenter/InOutUtils.cs b/Lab1.TouristInformationCenter/InOutUtils.cs index 9a282a4..5c975b7 100644 --- a/Lab1.TouristInformationCenter/InOutUtils.cs +++ b/Lab1.TouristInformationCenter/InOutUtils.cs @@ -100,14 +100,14 @@ namespace Lab1.TouristInformationCenter return; } - Console.WriteLine(new string('-', 97)); - Console.WriteLine("| {0,20} | {1,-15} | {2,-10} | {3,-18} | {4,-3} | {5,-4} |", "Vardas", "Miestas", "Tipas", "Darbo dienų kiekis", "Kaina", "Turi gidą?"); - Console.WriteLine(new string('-', 97)); + Console.WriteLine(new string('-', 100)); + Console.WriteLine("| {0,-20} | {1,-15} | {2,-10} | {3,18} | {4,8} | {5,-4} |", "Vardas", "Miestas", "Tipas", "Darbo dienų kiekis", "Kaina", "Turi gidą?"); + Console.WriteLine(new string('-', 100)); foreach (Museum m in museums) { - Console.WriteLine("| {0,20} | {1,-15} | {2,-10} | {3,-18} | {4,-5:f2} | {5,-10} |", m.Name, m.City, m.Type, m.Workdays.Count, m.Price, m.HasGuide ? "Taip" : "Ne"); + Console.WriteLine("| {0,-20} | {1,-15} | {2,-10} | {3,18} | {4,8:f2} | {5,-10} |", m.Name, m.City, m.Type, m.Workdays.Count, m.Price, m.HasGuide ? "Taip" : "Ne"); } - Console.WriteLine(new string('-', 97)); + Console.WriteLine(new string('-', 100)); } } } From 2faa52236a7c00224239b698d4bb3d5018b0cccb Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Wed, 17 Nov 2021 01:42:56 +0200 Subject: [PATCH 5/9] feat: add tests --- Lab1.TouristInformationCenter/tests/1/Museums.csv | 7 +++++++ Lab1.TouristInformationCenter/tests/2/Museums.csv | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 Lab1.TouristInformationCenter/tests/1/Museums.csv create mode 100644 Lab1.TouristInformationCenter/tests/2/Museums.csv diff --git a/Lab1.TouristInformationCenter/tests/1/Museums.csv b/Lab1.TouristInformationCenter/tests/1/Museums.csv new file mode 100644 index 0000000..308e5fa --- /dev/null +++ b/Lab1.TouristInformationCenter/tests/1/Museums.csv @@ -0,0 +1,7 @@ +MusuemA;Vilnius;History;1;1;0;1;1;0;0;5,49;0 +MusuemB;Kaunas;Computer;1;1;0;0;1;1;1;4,20;1 +MusuemC;Šiauliai;History;0;1;1;1;1;0;0;0,00;1 +MusuemD;Marijampolė;Food;1;12;1;1;1;1;1;6,90;1 +MusuemE;Alytus;History;0;1;0;1;1;1;1;10,49;0 +MusuemF;Kaimas;History;1;1;1;1;0;1;1;0,00;1 +MusuemG;Klaipėda;Space;1;1;1;1;0;0;0;0,00;0 diff --git a/Lab1.TouristInformationCenter/tests/2/Museums.csv b/Lab1.TouristInformationCenter/tests/2/Museums.csv new file mode 100644 index 0000000..1bc0bad --- /dev/null +++ b/Lab1.TouristInformationCenter/tests/2/Museums.csv @@ -0,0 +1,6 @@ +VilnausMuziejus;Vilnius;History;1;1;0;1;1;0;0;5,49;0 +KaunoMuziejus;Kaunas;Computer;1;1;0;1;1;1;1;4,69;1 +ŠiauliųMuziejus;Šiauliai;History;0;1;1;1;1;0;0;1,23;1 +MarijampolėsMuziejus;Marijampolė;Food;1;1;1;1;1;1;1;6,90;1 +AlytausMuziejus;Alytus;History;0;1;0;1;1;0;1;10,49;0 +KlaipėdosMuziejus;Klaipėda;Space;1;1;0;1;0;0;0;1,00;0 From 93127b4977efa04f2ac707cf3e8836eaf2d49450 Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Wed, 17 Nov 2021 02:03:03 +0200 Subject: [PATCH 6/9] fix: correct solution filename --- Lab1.Exercises.sln => Lab1.sln | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Lab1.Exercises.sln => Lab1.sln (100%) diff --git a/Lab1.Exercises.sln b/Lab1.sln similarity index 100% rename from Lab1.Exercises.sln rename to Lab1.sln From 7a92c86b1d18224c0c3ba987e5aea626a44b998b Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Thu, 25 Nov 2021 03:14:25 +0200 Subject: [PATCH 7/9] fix: add editorconfig --- .editorconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3159b2a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +root=true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = tab +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.cs] +indent_style = space +indent_size = 4 + From a5b10c3cb82eaf1e6871ed9f56aed23759466c9c Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Thu, 25 Nov 2021 16:37:48 +0200 Subject: [PATCH 8/9] fix: add dotnet cli config --- global.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 global.json diff --git a/global.json b/global.json new file mode 100644 index 0000000..4aa91ae --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "3.0.103" + } +} From 0fc53fc6abaf495302c9c971c23b6f4acb18bc55 Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Wed, 8 Dec 2021 20:43:44 +0200 Subject: [PATCH 9/9] fix: move files to 'Lab1' --- .editorconfig => Lab1/.editorconfig | 0 .gitignore => Lab1/.gitignore | 0 .../Lab1.1Savarankiskas}/1Savarankiskas.csproj | 0 {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/InOutUtils.cs | 0 {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/Program.cs | 0 {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/TaskUtils.cs | 0 {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/Tourist.cs | 0 {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/Tourists.csv | 0 {Lab1.Exercises.Register => Lab1/Lab1.Exercises.Register}/Dog.cs | 0 .../Lab1.Exercises.Register}/Dogs.csv | 0 .../Lab1.Exercises.Register}/Gender.cs | 0 .../Lab1.Exercises.Register}/InOutUtils.cs | 0 .../Lab1.Exercises.Register}/Lab1.Exercises.Register.csproj | 0 .../Lab1.Exercises.Register}/Program.cs | 0 .../Lab1.Exercises.Register}/TaskUtils.cs | 0 {Lab1.IMDB => Lab1/Lab1.IMDB}/Actors.csv | 0 {Lab1.IMDB => Lab1/Lab1.IMDB}/InOutUtils.cs | 0 {Lab1.IMDB => Lab1/Lab1.IMDB}/Lab1.IMDB.csproj | 0 {Lab1.IMDB => Lab1/Lab1.IMDB}/Movie.cs | 0 {Lab1.IMDB => Lab1/Lab1.IMDB}/Movies.csv | 0 {Lab1.IMDB => Lab1/Lab1.IMDB}/Program.cs | 0 {Lab1.IMDB => Lab1/Lab1.IMDB}/TaskUtils.cs | 0 .../Lab1.TouristInformationCenter}/InOutUtils.cs | 0 .../Lab1.TouristInformationCenter.csproj | 0 .../Lab1.TouristInformationCenter}/Museum.cs | 0 .../Lab1.TouristInformationCenter}/Museums.csv | 0 .../Lab1.TouristInformationCenter}/Program.cs | 0 .../Lab1.TouristInformationCenter}/TaskUtils.cs | 0 .../Lab1.TouristInformationCenter}/Weekday.cs | 0 .../Lab1.TouristInformationCenter}/tests/1/Museums.csv | 0 .../Lab1.TouristInformationCenter}/tests/2/Museums.csv | 0 Lab1.sln => Lab1/Lab1.sln | 0 README.md => Lab1/README.md | 0 global.json => Lab1/global.json | 0 34 files changed, 0 insertions(+), 0 deletions(-) rename .editorconfig => Lab1/.editorconfig (100%) rename .gitignore => Lab1/.gitignore (100%) rename {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/1Savarankiskas.csproj (100%) rename {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/InOutUtils.cs (100%) rename {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/Program.cs (100%) rename {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/TaskUtils.cs (100%) rename {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/Tourist.cs (100%) rename {Lab1.1Savarankiskas => Lab1/Lab1.1Savarankiskas}/Tourists.csv (100%) rename {Lab1.Exercises.Register => Lab1/Lab1.Exercises.Register}/Dog.cs (100%) rename {Lab1.Exercises.Register => Lab1/Lab1.Exercises.Register}/Dogs.csv (100%) rename {Lab1.Exercises.Register => Lab1/Lab1.Exercises.Register}/Gender.cs (100%) rename {Lab1.Exercises.Register => Lab1/Lab1.Exercises.Register}/InOutUtils.cs (100%) rename {Lab1.Exercises.Register => Lab1/Lab1.Exercises.Register}/Lab1.Exercises.Register.csproj (100%) rename {Lab1.Exercises.Register => Lab1/Lab1.Exercises.Register}/Program.cs (100%) rename {Lab1.Exercises.Register => Lab1/Lab1.Exercises.Register}/TaskUtils.cs (100%) rename {Lab1.IMDB => Lab1/Lab1.IMDB}/Actors.csv (100%) rename {Lab1.IMDB => Lab1/Lab1.IMDB}/InOutUtils.cs (100%) rename {Lab1.IMDB => Lab1/Lab1.IMDB}/Lab1.IMDB.csproj (100%) rename {Lab1.IMDB => Lab1/Lab1.IMDB}/Movie.cs (100%) rename {Lab1.IMDB => Lab1/Lab1.IMDB}/Movies.csv (100%) rename {Lab1.IMDB => Lab1/Lab1.IMDB}/Program.cs (100%) rename {Lab1.IMDB => Lab1/Lab1.IMDB}/TaskUtils.cs (100%) rename {Lab1.TouristInformationCenter => Lab1/Lab1.TouristInformationCenter}/InOutUtils.cs (100%) rename {Lab1.TouristInformationCenter => Lab1/Lab1.TouristInformationCenter}/Lab1.TouristInformationCenter.csproj (100%) rename {Lab1.TouristInformationCenter => Lab1/Lab1.TouristInformationCenter}/Museum.cs (100%) rename {Lab1.TouristInformationCenter => Lab1/Lab1.TouristInformationCenter}/Museums.csv (100%) rename {Lab1.TouristInformationCenter => Lab1/Lab1.TouristInformationCenter}/Program.cs (100%) rename {Lab1.TouristInformationCenter => Lab1/Lab1.TouristInformationCenter}/TaskUtils.cs (100%) rename {Lab1.TouristInformationCenter => Lab1/Lab1.TouristInformationCenter}/Weekday.cs (100%) rename {Lab1.TouristInformationCenter => Lab1/Lab1.TouristInformationCenter}/tests/1/Museums.csv (100%) rename {Lab1.TouristInformationCenter => Lab1/Lab1.TouristInformationCenter}/tests/2/Museums.csv (100%) rename Lab1.sln => Lab1/Lab1.sln (100%) rename README.md => Lab1/README.md (100%) rename global.json => Lab1/global.json (100%) diff --git a/.editorconfig b/Lab1/.editorconfig similarity index 100% rename from .editorconfig rename to Lab1/.editorconfig diff --git a/.gitignore b/Lab1/.gitignore similarity index 100% rename from .gitignore rename to Lab1/.gitignore diff --git a/Lab1.1Savarankiskas/1Savarankiskas.csproj b/Lab1/Lab1.1Savarankiskas/1Savarankiskas.csproj similarity index 100% rename from Lab1.1Savarankiskas/1Savarankiskas.csproj rename to Lab1/Lab1.1Savarankiskas/1Savarankiskas.csproj diff --git a/Lab1.1Savarankiskas/InOutUtils.cs b/Lab1/Lab1.1Savarankiskas/InOutUtils.cs similarity index 100% rename from Lab1.1Savarankiskas/InOutUtils.cs rename to Lab1/Lab1.1Savarankiskas/InOutUtils.cs diff --git a/Lab1.1Savarankiskas/Program.cs b/Lab1/Lab1.1Savarankiskas/Program.cs similarity index 100% rename from Lab1.1Savarankiskas/Program.cs rename to Lab1/Lab1.1Savarankiskas/Program.cs diff --git a/Lab1.1Savarankiskas/TaskUtils.cs b/Lab1/Lab1.1Savarankiskas/TaskUtils.cs similarity index 100% rename from Lab1.1Savarankiskas/TaskUtils.cs rename to Lab1/Lab1.1Savarankiskas/TaskUtils.cs diff --git a/Lab1.1Savarankiskas/Tourist.cs b/Lab1/Lab1.1Savarankiskas/Tourist.cs similarity index 100% rename from Lab1.1Savarankiskas/Tourist.cs rename to Lab1/Lab1.1Savarankiskas/Tourist.cs diff --git a/Lab1.1Savarankiskas/Tourists.csv b/Lab1/Lab1.1Savarankiskas/Tourists.csv similarity index 100% rename from Lab1.1Savarankiskas/Tourists.csv rename to Lab1/Lab1.1Savarankiskas/Tourists.csv diff --git a/Lab1.Exercises.Register/Dog.cs b/Lab1/Lab1.Exercises.Register/Dog.cs similarity index 100% rename from Lab1.Exercises.Register/Dog.cs rename to Lab1/Lab1.Exercises.Register/Dog.cs diff --git a/Lab1.Exercises.Register/Dogs.csv b/Lab1/Lab1.Exercises.Register/Dogs.csv similarity index 100% rename from Lab1.Exercises.Register/Dogs.csv rename to Lab1/Lab1.Exercises.Register/Dogs.csv diff --git a/Lab1.Exercises.Register/Gender.cs b/Lab1/Lab1.Exercises.Register/Gender.cs similarity index 100% rename from Lab1.Exercises.Register/Gender.cs rename to Lab1/Lab1.Exercises.Register/Gender.cs diff --git a/Lab1.Exercises.Register/InOutUtils.cs b/Lab1/Lab1.Exercises.Register/InOutUtils.cs similarity index 100% rename from Lab1.Exercises.Register/InOutUtils.cs rename to Lab1/Lab1.Exercises.Register/InOutUtils.cs diff --git a/Lab1.Exercises.Register/Lab1.Exercises.Register.csproj b/Lab1/Lab1.Exercises.Register/Lab1.Exercises.Register.csproj similarity index 100% rename from Lab1.Exercises.Register/Lab1.Exercises.Register.csproj rename to Lab1/Lab1.Exercises.Register/Lab1.Exercises.Register.csproj diff --git a/Lab1.Exercises.Register/Program.cs b/Lab1/Lab1.Exercises.Register/Program.cs similarity index 100% rename from Lab1.Exercises.Register/Program.cs rename to Lab1/Lab1.Exercises.Register/Program.cs diff --git a/Lab1.Exercises.Register/TaskUtils.cs b/Lab1/Lab1.Exercises.Register/TaskUtils.cs similarity index 100% rename from Lab1.Exercises.Register/TaskUtils.cs rename to Lab1/Lab1.Exercises.Register/TaskUtils.cs diff --git a/Lab1.IMDB/Actors.csv b/Lab1/Lab1.IMDB/Actors.csv similarity index 100% rename from Lab1.IMDB/Actors.csv rename to Lab1/Lab1.IMDB/Actors.csv diff --git a/Lab1.IMDB/InOutUtils.cs b/Lab1/Lab1.IMDB/InOutUtils.cs similarity index 100% rename from Lab1.IMDB/InOutUtils.cs rename to Lab1/Lab1.IMDB/InOutUtils.cs diff --git a/Lab1.IMDB/Lab1.IMDB.csproj b/Lab1/Lab1.IMDB/Lab1.IMDB.csproj similarity index 100% rename from Lab1.IMDB/Lab1.IMDB.csproj rename to Lab1/Lab1.IMDB/Lab1.IMDB.csproj diff --git a/Lab1.IMDB/Movie.cs b/Lab1/Lab1.IMDB/Movie.cs similarity index 100% rename from Lab1.IMDB/Movie.cs rename to Lab1/Lab1.IMDB/Movie.cs diff --git a/Lab1.IMDB/Movies.csv b/Lab1/Lab1.IMDB/Movies.csv similarity index 100% rename from Lab1.IMDB/Movies.csv rename to Lab1/Lab1.IMDB/Movies.csv diff --git a/Lab1.IMDB/Program.cs b/Lab1/Lab1.IMDB/Program.cs similarity index 100% rename from Lab1.IMDB/Program.cs rename to Lab1/Lab1.IMDB/Program.cs diff --git a/Lab1.IMDB/TaskUtils.cs b/Lab1/Lab1.IMDB/TaskUtils.cs similarity index 100% rename from Lab1.IMDB/TaskUtils.cs rename to Lab1/Lab1.IMDB/TaskUtils.cs diff --git a/Lab1.TouristInformationCenter/InOutUtils.cs b/Lab1/Lab1.TouristInformationCenter/InOutUtils.cs similarity index 100% rename from Lab1.TouristInformationCenter/InOutUtils.cs rename to Lab1/Lab1.TouristInformationCenter/InOutUtils.cs diff --git a/Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj b/Lab1/Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj similarity index 100% rename from Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj rename to Lab1/Lab1.TouristInformationCenter/Lab1.TouristInformationCenter.csproj diff --git a/Lab1.TouristInformationCenter/Museum.cs b/Lab1/Lab1.TouristInformationCenter/Museum.cs similarity index 100% rename from Lab1.TouristInformationCenter/Museum.cs rename to Lab1/Lab1.TouristInformationCenter/Museum.cs diff --git a/Lab1.TouristInformationCenter/Museums.csv b/Lab1/Lab1.TouristInformationCenter/Museums.csv similarity index 100% rename from Lab1.TouristInformationCenter/Museums.csv rename to Lab1/Lab1.TouristInformationCenter/Museums.csv diff --git a/Lab1.TouristInformationCenter/Program.cs b/Lab1/Lab1.TouristInformationCenter/Program.cs similarity index 100% rename from Lab1.TouristInformationCenter/Program.cs rename to Lab1/Lab1.TouristInformationCenter/Program.cs diff --git a/Lab1.TouristInformationCenter/TaskUtils.cs b/Lab1/Lab1.TouristInformationCenter/TaskUtils.cs similarity index 100% rename from Lab1.TouristInformationCenter/TaskUtils.cs rename to Lab1/Lab1.TouristInformationCenter/TaskUtils.cs diff --git a/Lab1.TouristInformationCenter/Weekday.cs b/Lab1/Lab1.TouristInformationCenter/Weekday.cs similarity index 100% rename from Lab1.TouristInformationCenter/Weekday.cs rename to Lab1/Lab1.TouristInformationCenter/Weekday.cs diff --git a/Lab1.TouristInformationCenter/tests/1/Museums.csv b/Lab1/Lab1.TouristInformationCenter/tests/1/Museums.csv similarity index 100% rename from Lab1.TouristInformationCenter/tests/1/Museums.csv rename to Lab1/Lab1.TouristInformationCenter/tests/1/Museums.csv diff --git a/Lab1.TouristInformationCenter/tests/2/Museums.csv b/Lab1/Lab1.TouristInformationCenter/tests/2/Museums.csv similarity index 100% rename from Lab1.TouristInformationCenter/tests/2/Museums.csv rename to Lab1/Lab1.TouristInformationCenter/tests/2/Museums.csv diff --git a/Lab1.sln b/Lab1/Lab1.sln similarity index 100% rename from Lab1.sln rename to Lab1/Lab1.sln diff --git a/README.md b/Lab1/README.md similarity index 100% rename from README.md rename to Lab1/README.md diff --git a/global.json b/Lab1/global.json similarity index 100% rename from global.json rename to Lab1/global.json