Skip to content
Open

123 #34

Show file tree
Hide file tree
Changes from all commits
Commits
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
51 changes: 21 additions & 30 deletions AppsLab.CSharp.Exercises.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-007-Casting", "src\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-007-Casting.Tests", "tests\AppsLab-007-Casting.Tests\AppsLab-007-Casting.Tests.csproj", "{5B78F61E-B52C-4920-BE97-42AADFAA726F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-008-ConsoleReadLine", "src\AppsLab-008-ConsoleReadLine\AppsLab-008-ConsoleReadLine.csproj", "{5314C734-E722-4454-A772-D0F4641E1563}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-009-Operators", "src\AppsLab-009-Operators\AppsLab-009-Operators.csproj", "{B6030D54-19E2-40EF-8C93-17669CEC23E0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-009-Operators.Tests", "tests\AppsLab-009-Operators.Tests\AppsLab-009-Operators.Tests.csproj", "{A6659FD2-5F11-432B-91B7-C64EAEAF669C}"
Expand Down Expand Up @@ -93,10 +91,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-033-NuGet", "src\Ap
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppsLab-034-Debug", "src\AppsLab-034-Debug\AppsLab-034-Debug.csproj", "{83C963FD-DC23-46E8-9545-F56197164810}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "homework", "homework\homework.csproj", "{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}"
EndProject
Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -190,18 +187,6 @@ Global
{5B78F61E-B52C-4920-BE97-42AADFAA726F}.Release|x64.Build.0 = Release|Any CPU
{5B78F61E-B52C-4920-BE97-42AADFAA726F}.Release|x86.ActiveCfg = Release|Any CPU
{5B78F61E-B52C-4920-BE97-42AADFAA726F}.Release|x86.Build.0 = Release|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Debug|x64.ActiveCfg = Debug|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Debug|x64.Build.0 = Debug|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Debug|x86.ActiveCfg = Debug|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Debug|x86.Build.0 = Debug|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Release|Any CPU.Build.0 = Release|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Release|x64.ActiveCfg = Release|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Release|x64.Build.0 = Release|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Release|x86.ActiveCfg = Release|Any CPU
{5314C734-E722-4454-A772-D0F4641E1563}.Release|x86.Build.0 = Release|Any CPU
{B6030D54-19E2-40EF-8C93-17669CEC23E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6030D54-19E2-40EF-8C93-17669CEC23E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6030D54-19E2-40EF-8C93-17669CEC23E0}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -226,18 +211,6 @@ Global
{A6659FD2-5F11-432B-91B7-C64EAEAF669C}.Release|x64.Build.0 = Release|Any CPU
{A6659FD2-5F11-432B-91B7-C64EAEAF669C}.Release|x86.ActiveCfg = Release|Any CPU
{A6659FD2-5F11-432B-91B7-C64EAEAF669C}.Release|x86.Build.0 = Release|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|x64.ActiveCfg = Debug|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|x64.Build.0 = Debug|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|x86.ActiveCfg = Debug|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Debug|x86.Build.0 = Debug|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|Any CPU.Build.0 = Release|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|x64.ActiveCfg = Release|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|x64.Build.0 = Release|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|x86.ActiveCfg = Release|Any CPU
{B141B973-9C0B-4512-B8B4-1237B596A8D2}.Release|x86.Build.0 = Release|Any CPU
{FD645D4C-9DC8-4603-A77B-8A4782F175F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD645D4C-9DC8-4603-A77B-8A4782F175F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD645D4C-9DC8-4603-A77B-8A4782F175F4}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -634,6 +607,21 @@ Global
{83C963FD-DC23-46E8-9545-F56197164810}.Release|x64.Build.0 = Release|Any CPU
{83C963FD-DC23-46E8-9545-F56197164810}.Release|x86.ActiveCfg = Release|Any CPU
{83C963FD-DC23-46E8-9545-F56197164810}.Release|x86.Build.0 = Release|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Debug|x64.ActiveCfg = Debug|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Debug|x64.Build.0 = Debug|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Debug|x86.ActiveCfg = Debug|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Debug|x86.Build.0 = Debug|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Release|Any CPU.Build.0 = Release|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Release|x64.ActiveCfg = Release|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Release|x64.Build.0 = Release|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Release|x86.ActiveCfg = Release|Any CPU
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{57860CA2-0054-465E-BD1E-024FF8D81354} = {56555FB0-B513-49EF-9002-A5AF135EA090}
Expand All @@ -643,7 +631,6 @@ Global
{F1E80A4A-241C-496D-92D6-B047A0EAF030} = {56555FB0-B513-49EF-9002-A5AF135EA090}
{AEEAB66C-8B62-4844-A721-1FA49E82FDEB} = {56555FB0-B513-49EF-9002-A5AF135EA090}
{5B78F61E-B52C-4920-BE97-42AADFAA726F} = {FC89E9B9-1723-4328-B6F1-00EE62E6260F}
{5314C734-E722-4454-A772-D0F4641E1563} = {56555FB0-B513-49EF-9002-A5AF135EA090}
{B6030D54-19E2-40EF-8C93-17669CEC23E0} = {56555FB0-B513-49EF-9002-A5AF135EA090}
{A6659FD2-5F11-432B-91B7-C64EAEAF669C} = {FC89E9B9-1723-4328-B6F1-00EE62E6260F}
{FD645D4C-9DC8-4603-A77B-8A4782F175F4} = {56555FB0-B513-49EF-9002-A5AF135EA090}
Expand Down Expand Up @@ -679,5 +666,9 @@ Global
{7BEA7878-B5BA-4480-BC56-2F7B836F64B9} = {56555FB0-B513-49EF-9002-A5AF135EA090}
{38FFE1DF-4B49-40C1-9908-51860BCF2D3E} = {56555FB0-B513-49EF-9002-A5AF135EA090}
{83C963FD-DC23-46E8-9545-F56197164810} = {56555FB0-B513-49EF-9002-A5AF135EA090}
{CA90FDFB-E288-4BF3-AB5B-1493DB12F4C1} = {56555FB0-B513-49EF-9002-A5AF135EA090}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {31F49123-4C4A-4A0F-8756-A7035ED3F281}
EndGlobalSection
EndGlobal
10 changes: 10 additions & 0 deletions ConsoleApp1/ConsoleApp1.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>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
36 changes: 36 additions & 0 deletions ConsoleApp1/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

string cislo1 = Console.ReadLine ();
decimal prvecislo = decimal.Parse (cislo1);
string operacia = Console.ReadLine();
string cislo2 = Console.ReadLine();
decimal druhecislo = decimal.Parse (cislo2);

if (operacia == "-")
{
decimal vysledok = prvecislo - druhecislo;
Console.WriteLine($"vysledok je {vysledok}");
}

else if (operacia == "+")
{
decimal vysledok = prvecislo + druhecislo;
Console.WriteLine($"Vysledok je {vysledok}.");
}

else if (operacia == "*")
{
decimal vysledok = prvecislo * druhecislo;
Console.WriteLine($"Vysledok je{vysledok}.");
}
else if (operacia == "/")
{
decimal vysledok = prvecislo / druhecislo;
Console.WriteLine($"Vysledok je {vysledok}");
}

else if (operacia == "%")
{
decimal vysledok = prvecislo % druhecislo;
Console.WriteLine($"Vysledok je:{vysledok}.");
}
Console.WriteLine("dakujem ze si pouzil moju kalkulacku dovidenia");
1 change: 1 addition & 0 deletions domaci coding for fun/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

11 changes: 11 additions & 0 deletions domaci coding for fun/domacicodingforfun.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>net8.0</TargetFramework>
<RootNamespace>domaci_coding_for_fun</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
21 changes: 21 additions & 0 deletions homework/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Console.WriteLine("Zadaj cislo 1");
string number1 = Console.ReadLine();
decimal cislo1 = decimal.Parse(number1);
Console.WriteLine("Zadaj operaciu +-/%");
string operacia = Console.ReadLine();
Console.WriteLine("Zadaj cislo 2");
string number2 = Console.ReadLine();
decimal cislo2 = decimal.Parse(number2);

decimal vysledok = operacia switch
{
"+" => (cislo1 + cislo2),
"/" => (cislo1 / cislo2),
"-" => (cislo1 - cislo2),
"*" => (cislo1 * cislo2),
"%" => (cislo1 % cislo2),
};

Console.WriteLine(vysledok);


10 changes: 10 additions & 0 deletions homework/homework.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>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion src/AppsLab-001-StartHere/Greetings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class Greetings
/// <returns>A string containing the greeting message.</returns>
public string Hello()
{
return "Hello World!";
return "Hello AppsLab!";
}
}
4 changes: 3 additions & 1 deletion src/AppsLab-002-ConsoleWriteLine/Program.cs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Console.WriteLine("Hello, World!");
int age = 1024;
string name = "Neviem";
Console.WriteLine($"The name is {name} and I am {age} years old, I am young");
24 changes: 22 additions & 2 deletions src/AppsLab-005-DataTypes/Program.cs
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
float neviem = 0.11111f;
int mojeCislo = 123456;
string mojeSlovo = "Hello World";
bool mojaBoolHodnota = true;
DateTime dnesnyDatum = DateTime.Now;
var neviem2 = "dfghjk";
int sucet = mojeCislo + 5;
const int MaxStudents = 15;





Console.WriteLine("Maximlany pocet ziakov v triede je:" + MaxStudents);

Console.WriteLine(mojeCislo);
Console.WriteLine(mojeSlovo);
Console.WriteLine(dnesnyDatum.ToString("yyyy.MM.dd"));
Console.WriteLine(mojaBoolHodnota);
Console.WriteLine(sucet);
Console.WriteLine($"Hodnota Float je:{neviem}");
Console.WriteLine(neviem2);
9 changes: 7 additions & 2 deletions src/AppsLab-006-Constants/Program.cs
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
const int MaxPoints = 100;
const int MinAgeForDrivingLicence = 17;
const string WelcomeMessage = "Vitajte tu v tomto teste";

Console.WriteLine(MaxPoints);
Console.WriteLine(MinAgeForDrivingLicence);
Console.WriteLine(WelcomeMessage);
108 changes: 45 additions & 63 deletions src/AppsLab-007-Casting/Converter.cs
Original file line number Diff line number Diff line change
@@ -1,63 +1,45 @@
namespace AppsLab_007_Casting;

/// <summary>
/// This class contains methods to convert between different data types.
/// </summary>
public class Converter
{
/// <summary>
/// This method converts a string to an integer.
/// </summary>
public double IntToDouble(int number)
{
throw new NotImplementedException();
}

/// <summary>
/// This method converts a double to an integer.
/// </summary>
public int DoubleToInt(double number)
{
throw new NotImplementedException();
}

/// <summary>
/// This method converts a string to a double.
/// </summary>
public double StringToDouble(string number)
{
throw new NotImplementedException();
}

/// <summary>
/// This method converts a double to a string.
/// </summary>
public string DoubleToString(double number)
{
throw new NotImplementedException();
}

/// <summary>
/// This method converts a string to a boolean.
/// </summary>
public string IntToString(int number)
{
throw new NotImplementedException();
}

/// <summary>
/// This method converts a boolean to a string.
/// </summary>
public bool StringToBool(string boolValue)
{
throw new NotImplementedException();
}

/// <summary>
/// This method converts a boolean to a string.
/// </summary>
public string BoolToString(bool boolValue)
{
throw new NotImplementedException();
}
}
//namespace AppsLab_007_Casting;

//public class Converter
//{

// public double IntToDouble(int number)
// {

// return Convert.ToDouble(number);
// }

// public int DoubleToInt(double number)
// {
// return Convert.ToInt(number);
// }

// public double StringToDouble(string number)
// {
// return Convert.ToDouble(number);
// }


// public string DoubleToString(double number)
// {
// return Convert.ToString(number);
// }


// public string IntToString(int number)
// {
// return Convert.ToString(number);
// }


// public bool StringToBool(string boolValue)
// {
// return Convert.ToBool(boolValue);
// }


// public string StringToBool(bool boolValue)
// {
// return Convert.ToBool(boolValue);
// }
//}
Loading