Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
87b0149
commit message
mato-2009 Sep 12, 2024
ca5e8c9
Datatypes Mato
mato-2009 Sep 17, 2024
144e80e
008 console readline kovalcik
mato-2009 Sep 17, 2024
a305300
008 hotove komplet
mato-2009 Sep 17, 2024
8f023a6
008 cisla
mato-2009 Sep 17, 2024
8ab3624
zhodovanie hesiel 008
mato-2009 Sep 17, 2024
1f70c0b
heslo sa zhoduje 008
mato-2009 Sep 17, 2024
a4d5ed1
mato strings 24.9
mato-2009 Sep 24, 2024
6aec3b0
mato 015 24.9
mato-2009 Sep 24, 2024
9ff8829
mato 09 24.9
mato-2009 Sep 24, 2024
0a0747c
012 boolean 26.9 mato
mato-2009 Sep 26, 2024
73bba7c
cvicenie podmienky 26.9 mato
mato-2009 Sep 26, 2024
9aee354
0013 29.9 kovalcik
mato-2009 Sep 29, 2024
5fbcaa8
1.10 cvicenie cikly kovalcik
mato-2009 Oct 1, 2024
6749d6d
nedorobene cykli du 1.10
mato-2009 Oct 1, 2024
f2a6a0f
metody du
mato-2009 Oct 8, 2024
2d6d6ae
"random cvicenie" 3
mato-2009 Oct 8, 2024
35461ec
obchod cvicenie
mato-2009 Oct 10, 2024
bf9d8c9
cvicenie_OOP_Hra
mato-2009 Oct 15, 2024
96e08d7
cvicenia hra mana
mato-2009 Oct 17, 2024
ada4c32
rectangle
mato-2009 Oct 22, 2024
8943a2c
mesto
mato-2009 Oct 24, 2024
7c98f26
mesto a obcan cvicenie
mato-2009 Oct 29, 2024
18abc77
private,,,,
mato-2009 Nov 19, 2024
b63aef4
projekt polrok
mato-2009 Nov 21, 2024
6ffbbef
projekt polrok kniznica/sigma
mato-2009 Dec 10, 2024
5d3ce91
aplikacia WPF
mato-2009 Jan 28, 2025
5a83c2f
tictactoe
mato-2009 Jan 30, 2025
9bfdc70
WPF piskorky funkce
mato-2009 Feb 4, 2025
bff769d
suboj pokemoni funkcne
mato-2009 Feb 11, 2025
1c4e527
pokemon game extension map
mato-2009 Feb 11, 2025
0c54a0e
pokemon 2
mato-2009 Feb 13, 2025
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
396 changes: 338 additions & 58 deletions AppsLab.CSharp.Exercises.sln

Large diffs are not rendered by default.

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

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

<ItemGroup>
<None Update="studenti.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="studenti_large.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="studenti_large_chyba.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
87 changes: 87 additions & 0 deletions Cvicenie Vinimky/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using Cvicenie_Vynimky;
using System.Data;

namespace Cvicenie_Vinimky
{
internal class Program
{
static void Main(string[] args)
{
/*
//nacitavanie zo subora student.csv a vytvorenie studentov
var data = File.ReadAllLines("studenti.csv");
var students = new List<Student>();
foreach (var row in data.Skip(1))
{
var splits = row.Split(',');
var newStudent = new Student(splits[1], splits[2], Int32.Parse(splits[3]), "I.AI");
students.Add(newStudent);


}

var aaa = 5;
//priklad na vinimku pri deleni nulou a nespravnym indexom
try
{
int[] deviders = { 0, 2, 3 };
int value = deviders[2];
int result = 5 / value;
Console.WriteLine(result);
}
catch (IndexOutOfRangeException ex)
{
Console.WriteLine("Chyba pristup mimo rozsah pole.");




}
catch (DivideByZeroException ex)
{
Console.WriteLine("Chyba delenie nulou nieje povolene");
}

var splits = row.Split(',');
try
{
var newStudent = new Student(splits[0], splits[1], splits[2], Int32.Parse(splits[3]), "I.AI", splits[4];
students.Add(newStudent);


}

catch (Exception e)
{
Console.WriteLine("Chyba pri nacitani studenta " + row);
}

*/


Student[] students = new Student[]
{
new Student("John", "Doe", 20, "Class A"){ Grades = new List<int>(){1,2,3,4,4,2,1}},
new Student("Jane", "Smith", 22, "Class B"),
new Student("Sam", "Brown", 19, "Class C")
};
var firstStudent = students[0];
while (true)
{
try
{
Console.WriteLine("Zadajte znamku studentovi:");
int znamka = Int32.Parse(Console.ReadLine());
firstStudent.AddNewGrade(znamka);
Console.WriteLine(firstStudent.Grades.Average());
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}

}

}
}
7 changes: 7 additions & 0 deletions Cvicenie Vinimky/Student.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;

7 changes: 7 additions & 0 deletions Cvicenie Vinimky/studenti.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ID,MENO,PRIEZVISKO,VEK,POHLAVIE
1,John,Doe,20,Man
2,Jane,Smith,22,Woman
2,Sam,Brown,19,Man
3,Anna,White,23,Woman
4,Tom,Jones,21,Man
5,Lucy,Taylor,20,Woman
Loading