Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frič Pull #19

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fa0aa28
commit message
Sep 10, 2024
fd1c713
commit message
Sep 12, 2024
deb9ede
Dokončené cvičenie 005-DataTypes 17.9 2024
Sep 17, 2024
f309434
Dokončené cvičenie 005- DataTypes 17.9 2024
Sep 17, 2024
c13ee92
Dokončené cvičenie 008-ConsoleReadLine 17.9 2024
Sep 17, 2024
328f127
Prijatie mena a hesla hotové 17.9. 2024
Sep 17, 2024
0211c05
mato
Sep 19, 2024
e82a29f
mato
Sep 19, 2024
5c474e9
Dokončené stringy 011_Strings.StringManipulator - 24.9 2024
Sep 24, 2024
f64519e
Dokončené cvičenie 015_Arrays.ArrayProcesor - 24.9 2024
Sep 24, 2024
3247fbb
Dokončené cvičenie 009_Operators.Calculator - 24.9. 2024
Sep 24, 2024
c049166
Dokončené cvičenie 012_boolean.BooleanLogic - 26.9. 2024
Sep 26, 2024
8d7b853
Vlastný projekt - 26.9. 2024
Sep 26, 2024
57e9b76
Dokončené cvičenie 013-Conditions - 30.9. 2024
MartinFric712 Sep 30, 2024
350fc3d
Cvicenie_List / 1.10. 2024
Oct 1, 2024
0e31d4f
Cykly - 30.1. 2024
Oct 1, 2024
b509471
Cykly
Oct 1, 2024
89e9973
List
Oct 1, 2024
a7a9c62
Samohlásky
Oct 8, 2024
c0a0afe
Oct 8, 2024
9e0e956
Opakovanie_01
Oct 10, 2024
8e97f8d
Cvicenie_OOP_Hra
Oct 15, 2024
00a0960
Cvicenie_OOP_Hra Pokracujeme
Oct 17, 2024
484a2b9
Obcan a Mesto s pracami
Oct 24, 2024
dad4744
Dkonceny Obcan a Mesto
Oct 29, 2024
ae25023
Mesto a Obcan zlahcene-dokoncene
Oct 29, 2024
2a2fcb4
Autopozicovna - dkoncene
Nov 5, 2024
69fbdcd
Programator/Stavbar
Nov 5, 2024
1777629
LINQ
Nov 7, 2024
d219229
LINQ
Nov 12, 2024
414780e
OOP_Tim
Nov 19, 2024
c045b91
Obcan a Mesto
Nov 19, 2024
e40562f
Projekt - polrok
Nov 21, 2024
5eaba7e
Cvičenie_Výnimky
Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Aplikácia/Aplikácia.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>
38 changes: 38 additions & 0 deletions Aplikácia/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// See https://aka.ms/new-console-template for more information


using System;
using System.Collections.Generic;

class Program
{
static void Main()
{
// Inicializácia prázdneho zoznamu
List<string> mena = new List<string>();

// Nekonečný cyklus pre zadávanie mien
while (true)
{
Console.Write("Zadajte meno (alebo napíšte 'stop' pre ukončenie): ");
string meno = Console.ReadLine();

// Ak užívateľ zadá 'stop', ukončíme cyklus
if (meno.ToLower() == "stop")
{
break;
}

// Pridanie mena do zoznamu
mena.Add(meno);
Console.WriteLine($"{meno} bolo pridané do zoznamu.");
}

// Vypísanie všetkých zadaných mien
Console.WriteLine("\nZoznam všetkých zadaných mien:");
foreach (string meno in mena)
{
Console.WriteLine(meno);
}
}
}
392 changes: 334 additions & 58 deletions AppsLab.CSharp.Exercises.sln

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions Autopozicovna/Auto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

class Auto
{
public string Znacka { get; set; }
public string Model { get; set; }
public decimal CenaZaDen { get; set; }

public Auto(string znacka, string model, decimal cenaZaDen)
{
Znacka = znacka;
Model = model;
CenaZaDen = cenaZaDen;
}

public virtual void VypisInfo()
{
Console.WriteLine($"Značka: {Znacka}, Model: {Model}, Cena za deň: {CenaZaDen}€");
}

public decimal VypocitajCenu(int dni)
{
return CenaZaDen * dni;
}
}
10 changes: 10 additions & 0 deletions Autopozicovna/Autopozicovna.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>
20 changes: 20 additions & 0 deletions Autopozicovna/Elektrickeauto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@


namespace Autopozicovna
{
class Elektrickeauto : Auto
{
public int KapacitaBaterie { get; set; }
public int DojazdNaNabitie { get; set; }
public Elektrickeauto(string znacka, string model, decimal cenaZaDen, int kapacitaBaterie, int dojazdNaNabitie) : base(znacka,model,cenaZaDen)
{
KapacitaBaterie = kapacitaBaterie;
DojazdNaNabitie = dojazdNaNabitie;
}
public override void VypisInfo()
{
base.VypisInfo();
Console.WriteLine($"Kapacita batérie: {KapacitaBaterie} kWh, Dojazd na nabitie: {DojazdNaNabitie} km");
}
}
}
32 changes: 32 additions & 0 deletions Autopozicovna/Pozicovna.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
class Pozicovna
{
private List<Auto> zoznamAut = new List<Auto>();

public void PridajAuto(Auto auto)
{
zoznamAut.Add(auto);
}

public void VypisVsetkyAut()
{
for (int i = 0; i < zoznamAut.Count; i++)
{
Console.WriteLine($"Auto {i + 1}:");
zoznamAut[i].VypisInfo();
Console.WriteLine();
}
}

public decimal? VypocitajCenuPrenajmu(int cisloAuta, int dni)
{
if (cisloAuta >= 0 && cisloAuta < zoznamAut.Count)
{
return zoznamAut[cisloAuta].VypocitajCenu(dni);
}
else
{
Console.WriteLine("Neplatne cislo auta.");
return null;
}
}
}
33 changes: 33 additions & 0 deletions Autopozicovna/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Autopozicovna;

class Program
{
static void Main(string[] args)
{
// Vytvorenie áut
var sportoveAuto = new Sportoveauto("Ferrari", "488", 200m, 330, 3.0);
var velkeAuto = new Velkeauto("Ford", "Transit", 80m, 8, 500);
var elektrickeAuto = new Elektrickeauto("Tesla", "Model 3", 150m, 75, 500);

// Vytvorenie autopožičovne a pridanie áut
var pozicovna = new Pozicovna();
pozicovna.PridajAuto(sportoveAuto);
pozicovna.PridajAuto(velkeAuto);
pozicovna.PridajAuto(elektrickeAuto);

// Vypis všetkých áut
pozicovna.VypisVsetkyAut();

// Vypocet ceny prenajmu
Console.Write("Zadajte cislo auta (1, 2, 3): ");
int indexAuto = int.Parse(Console.ReadLine()) - 1;
Console.Write("Zadajte počet dní na prenájom: ");
int dni = int.Parse(Console.ReadLine());
var cena = pozicovna.VypocitajCenuPrenajmu(indexAuto, dni);

if (cena.HasValue)
{
Console.WriteLine($"Celková cena prenájmu: {cena.Value}€");
}
}
}
20 changes: 20 additions & 0 deletions Autopozicovna/Sportoveauto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

namespace Autopozicovna
{
class Sportoveauto : Auto
{
public int MaximalnaRychlost { get; set; }
public double Zrychlenie { get; set; }
public Sportoveauto(string znacka, string model, decimal cenaZaDen, int maximalnaRychlost, double zrychlenie) : base(znacka, model, cenaZaDen)
{
MaximalnaRychlost = maximalnaRychlost;
Zrychlenie = zrychlenie;
}
public override void VypisInfo()
{
base.VypisInfo();
Console.WriteLine($"Max. rýchlosť: {MaximalnaRychlost} km/h, Zrýchlenie: {Zrychlenie} s");
}
}
}

18 changes: 18 additions & 0 deletions Autopozicovna/Velkeauto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class Velkeauto : Auto
{
public int KapacitaPasazierov { get; set; }
public int ObjemBatoziny { get; set; }

public Velkeauto(string znacka, string model, decimal cenaZaDen, int kapacitaPasazierov, int objemBatoziny)
: base(znacka, model, cenaZaDen)
{
KapacitaPasazierov = kapacitaPasazierov;
ObjemBatoziny = objemBatoziny;
}

public override void VypisInfo()
{
base.VypisInfo();
Console.WriteLine($"Kapacita pasažierov: {KapacitaPasazierov}, Objem batožiny: {ObjemBatoziny} litrov");
}
}
39 changes: 39 additions & 0 deletions Cvicenie Mesto a Obcan/City.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ObcaniaAmesto
{
public class City
{
public string NazovMesta { get; set; }
public List<Citizen> Obcania { get; set; }

public City()
{

}

public City(string nazovMesta, List<Citizen> Obcania)
{
NazovMesta = nazovMesta;
this.Obcania = Obcania;
}

public void PridajObcana(Citizen obcaniaList)
{
Obcania.Add(obcaniaList);
}

public void VypisObcanov()
{
foreach (var citizen in Obcania)
{

Console.WriteLine();
}
}
}
}
11 changes: 11 additions & 0 deletions Cvicenie Mesto a Obcan/Cvicenie Mesto a Obcan.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>Cvicenie_Mesto_a_Obcan</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
30 changes: 30 additions & 0 deletions Cvicenie Mesto a Obcan/Obcan.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ObcaniaAmesto
{
public class Citizen
{
public string Name { get; set; }
public int Age { get; set; }

public Citizen()
{

}

public Citizen(string name, int age)
{
Name = name;
Age = age;
}

public void VypisInfo()
{
Console.WriteLine("Meno: " + Name + ", Vek: " + Age);
}
}
}
15 changes: 15 additions & 0 deletions Cvicenie Mesto a Obcan/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Cvicenie_Mesto_a_Obcan
{
internal class Program
{
static void Main(string[] args)
{
List<string> Obcan = new List<string>();

{


}
}
}
}
10 changes: 10 additions & 0 deletions Cvicenie2/Cvicenie2.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>
26 changes: 26 additions & 0 deletions Cvicenie2/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace Cvicenie2
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Zadaj sirku obdlzika ! : ");
int sirka = Int32.Parse(Console.ReadLine());
Console.WriteLine("Zadaj vysku obdlznika ! : ");
int vyska = Int32.Parse(Console.ReadLine());
Rectangle re = new Rectangle(vyska ,sirka);
int obsah = re.ObsahObdlznika();
Console.WriteLine(" Obsah je " + obsah);

int sirka2 = re.sirka;
int vyska2 = re.vyska;
Rectangle ra = new Rectangle(vyska2 * 10,sirka2 * 10);
int obsah2 = ra.ObsahObdlznika();
Console.WriteLine("Obsah druheho obdlznika je " + obsah2);

}
}
}



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

namespace Cvicenie2
{
public class Rectangle
{
public int sirka { get; set; }
public int vyska { get; set; }
public Rectangle(int sirka, int vyska)
{
this.sirka = sirka;
this.vyska = vyska;
}
public int ObsahObdlznika()
{
return sirka * vyska;
}
}
}





10 changes: 10 additions & 0 deletions Cvicenie_OOP_Hra/Cvicenie_OOP_Hra.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>
Loading