Skip to content

Commit

Permalink
pushik
Browse files Browse the repository at this point in the history
  • Loading branch information
moravcikj24 authored and moravcikj24 committed Nov 19, 2024
1 parent 80747f7 commit 31e1fa1
Show file tree
Hide file tree
Showing 13 changed files with 203 additions and 19 deletions.
32 changes: 31 additions & 1 deletion AppsLab.CSharp.Exercises.sln
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Autopozicovna", "Autopozico
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINQ", "LINQ\LINQ.csproj", "{EE3FA96B-9729-4966-9A1B-6D2B651EFEB8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINQ - kniha", "LINQ - kniha\LINQ - kniha.csproj", "{62B727AC-A174-466E-ABBF-5BB8F8929CEF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINQ - kniha", "LINQ - kniha\LINQ - kniha.csproj", "{62B727AC-A174-466E-ABBF-5BB8F8929CEF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kniha-OOP", "Kniha-OOP\Kniha-OOP.csproj", "{7DE79263-AF2A-443D-9A60-19B2D1D554DF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tim_OPP", "Tim_OPP\Tim_OPP.csproj", "{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -747,6 +751,30 @@ Global
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Release|x64.Build.0 = Release|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Release|x86.ActiveCfg = Release|Any CPU
{62B727AC-A174-466E-ABBF-5BB8F8929CEF}.Release|x86.Build.0 = Release|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Debug|x64.ActiveCfg = Debug|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Debug|x64.Build.0 = Debug|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Debug|x86.ActiveCfg = Debug|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Debug|x86.Build.0 = Debug|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Release|Any CPU.Build.0 = Release|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Release|x64.ActiveCfg = Release|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Release|x64.Build.0 = Release|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Release|x86.ActiveCfg = Release|Any CPU
{7DE79263-AF2A-443D-9A60-19B2D1D554DF}.Release|x86.Build.0 = Release|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Debug|x64.ActiveCfg = Debug|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Debug|x64.Build.0 = Debug|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Debug|x86.ActiveCfg = Debug|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Debug|x86.Build.0 = Debug|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Release|Any CPU.Build.0 = Release|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Release|x64.ActiveCfg = Release|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Release|x64.Build.0 = Release|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Release|x86.ActiveCfg = Release|Any CPU
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -804,6 +832,8 @@ Global
{D5127D7B-EA97-4E8B-AA94-C3CA1F3DEABB} = {2F0E47F2-96C0-40C8-BBF0-438A7EDC1CEB}
{EE3FA96B-9729-4966-9A1B-6D2B651EFEB8} = {2F0E47F2-96C0-40C8-BBF0-438A7EDC1CEB}
{62B727AC-A174-466E-ABBF-5BB8F8929CEF} = {2F0E47F2-96C0-40C8-BBF0-438A7EDC1CEB}
{7DE79263-AF2A-443D-9A60-19B2D1D554DF} = {2F0E47F2-96C0-40C8-BBF0-438A7EDC1CEB}
{5D6247B9-C3BB-4FDA-BAA0-C55133F38C5D} = {2F0E47F2-96C0-40C8-BBF0-438A7EDC1CEB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3C50C64B-7126-4A88-B950-9B6071C82736}
Expand Down
11 changes: 11 additions & 0 deletions Kniha-OOP/Kniha-OOP.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Kniha_OOP</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
14 changes: 14 additions & 0 deletions Kniha-OOP/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Kniha_OOP
{
internal class Program
{
static void Main(string[] args)
{
kniha kniha = new kniha( "Neviem",99 );

kniha.Nazov = ("Neviem");


}
}
}
47 changes: 47 additions & 0 deletions Kniha-OOP/kniha.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kniha_OOP
{
public class kniha
{
private string nazov;
private int pocetStran;

public kniha() { }

public kniha(string nazov, int pocetStran)
{
this.nazov = nazov;
this.pocetStran = pocetStran;
}

public string Nazov
{
get { return nazov; }
set { nazov = value; }
}

public int PocetStran
{
get { return pocetStran; }
set
{
if (pocetStran > 0)
pocetStran = value;

else
Console.WriteLine("More mas problem!");

}





}
}
}
8 changes: 4 additions & 4 deletions Mesto a obcan/Elekrikari.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ namespace Mesto_a_obcan
{
public class Elekrikari : Obcan
{
public string programovacijazyk;
public Elekrikari(string meno, int vek, string programovacijazyk) : base(meno, vek)
protected string typkablu { get; set; }
public Elekrikari(string meno, int vek, string typkablu) : base(meno, vek)
{
this.programovacijazyk = programovacijazyk;
this.typkablu = typkablu;
}
public override void VypisInfo()
{
Console.WriteLine("Meno: " + meno + " Vek " + vek + " " + programovacijazyk);
Console.WriteLine("Meno: " + meno + " Vek " + vek + " " + typkablu);
}
}
}
4 changes: 2 additions & 2 deletions Mesto a obcan/GeneratorObcanov.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace Mesto_a_obcan
public static class GeneratorObcanov
{
private static string[] mena = { "Igor", "Anna", "Peter", "Jana", "Martin", "Lucia", "Tomáš", "Eva", "Michal", "Zuzana", "Marek", "Katarína", "Andrej", "Lenka", "Patrik",
"Monika", "Filip", "Veronika", "Richard", "Simona", "Róbert", "Mária", "Jakub", "Barbora", "Adam", "Dominika", "Lukáš", "Daniela", "Vladimír", "Nikola" };
private static string[] programovaciejazyky = { "C#", "Python", "C++", "Java", "C" };
"Monika", "Filip", "Veronika", "Richard", "Stary", "Róbert", "Mária", "Jakub", "Barbora", "Adam", "Dominika", "Lukáš", "Daniela", "2SekundovyMato", "Nikola" };
private static string[] programovaciejazyky = { "Med", "Zerte olovo svine", "Opticky", "Zeleny", "Nekabluje" };
public static Obcan GenerujObcana()
{
Random r = new Random();
Expand Down
20 changes: 16 additions & 4 deletions Mesto a obcan/Mesto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@

namespace Mesto_a_obcan
{
class Mesto
class Mesto
{
public string NazovMesta { get; set; }
public List<Obcan> obcania { get; set; }

private string NazovMesta;
private List<Obcan> obcania;


public string nazovMesta
{
get { return NazovMesta; }
set { NazovMesta = value; }
}

public List<Obcan> Obcania
{
get { return obcania; }
set { obcania = value; }
}
public Mesto(string nazovMesta)
{
this.NazovMesta = nazovMesta;
Expand Down
15 changes: 13 additions & 2 deletions Mesto a obcan/Obcan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@ namespace Mesto_a_obcan
{
public class Obcan
{
public string meno { get; set; }
public int vek { get; set; }
protected string meno;
protected int vek;

public string Meno
{
get { return meno; }
set { meno = value; }
}
public int Vek
{
get { return vek; }
set { vek = value; }
}

public Obcan(string meno, int vek)
{
Expand Down
11 changes: 6 additions & 5 deletions Mesto a obcan/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static void Main(string[] args)
Bratislava.PridajObcanadomesta(o);
}*/

while (Bratislava.obcania.Count < 31)
while (Bratislava.Obcania.Count < 31)
{
Elekrikari o = GeneratorObcanov.GenerujJayzk();
Bratislava.PridajObcanadomesta(o);
Expand All @@ -33,13 +33,14 @@ static void Main(string[] args)


//Vypis obcanov Bratislavy
Bratislava.VypisObcanov();
Bratislava.VypisObcanov();


Console.WriteLine($" ___ __ ____________ ____ ___ _____ ___ ____ \r\n / | / / / /_ __/ __ \\/ __ )/ /__ / / | / __ \\\r\n / /| |/ / / / / / / / / / __ / /| | / / / /| | / /_/ /\r\n / ___ / /_/ / / / / /_/ / /_/ / ___ |/ /__/ ___ |/ _, _/ \r\n/_/ |_\\____/ /_/ \\____/_____/_/ |_/____/_/ |_/_/ |_|








}

Expand Down
2 changes: 1 addition & 1 deletion Mesto a obcan/SenorElektrikar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Mesto_a_obcan
{
public class SenorElektrikar : Elekrikari
{
public int pocetkablov;
private int pocetkablov;
public SenorElektrikar(string meno, int vek, string typkablu, int pocetkablov) : base(meno, vek, typkablu)
{
this.pocetkablov = pocetkablov;
Expand Down
3 changes: 3 additions & 0 deletions Tim_OPP/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@



45 changes: 45 additions & 0 deletions Tim_OPP/Tim.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tim_OPP
{
public class Tim
{
private string nazov;

private static int pocet_timov = 0;


public Tim(string nazov)
{
this.nazov = nazov;
++pocet_timov;
}

public static int ZiskajPocetTimov()
{
return pocet_timov;
}
public string ZiskajNazov()
{
return nazov;
}

}
public class Program
{
public static void Main()
{
Tim tim1 = new Tim("Downi");
Tim tim2 = new Tim("Updowni");
Tim tim3 = new Tim("Middowni");

Console.WriteLine("Celkovy pocet timov: " + Tim.ZiskajPocetTimov()); //3
}
}
}

10 changes: 10 additions & 0 deletions Tim_OPP/Tim_OPP.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

0 comments on commit 31e1fa1

Please sign in to comment.