This commit is contained in:
2022-05-31 09:44:01 +02:00
parent 11972339b5
commit 90a869e261
183 changed files with 201479 additions and 32 deletions

View File

@@ -6,13 +6,14 @@ using System.Threading.Tasks;
namespace calculator
{
class Program
public class Program
{
static void Main(string[] args)
public static void Main(string[] args)
{
Kalkulatorr cal = new Kalkulatorr();
cal.beker();
cal.kiir();
Kalkulatorr cal = new Kalkulatorr(5,5,'+');
//cal.beker();
Console.WriteLine(cal.szamolas());
Console.ReadKey();
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

Binary file not shown.

View File

@@ -7,41 +7,33 @@ using System.Threading.Tasks;
namespace calculator
{
public class Kalkulatorr
{
{
private int szam1 = 0;
private int szam2 = 0;
private char muvjel;
private int eredm = 0;
private string uzen = "A művelet eredménye: ";
private string uzen;
public Kalkulatorr()
{
}
public Kalkulatorr(int szam1, int szam2, char muvjel, int eredm, string uzen)
public Kalkulatorr(int szam1, int szam2, char muvjel)
{
this.szam1 = szam1;
this.szam2 = szam2;
this.muvjel = muvjel;
this.eredm = eredm;
this.uzen = uzen;
}
public void beker()
{
Console.WriteLine("Adja meg az első számot");
szam1 = 4; //int.Parse(Console.ReadLine());
szam1 = int.Parse(Console.ReadLine());
Console.WriteLine("Adja meg a második számot");
szam2 = 4; //int.Parse(Console.ReadLine());
szam2 = int.Parse(Console.ReadLine());
Console.WriteLine("Adja meg a műveleti jelet");
muvjel = '+'; //Convert.ToChar(Console.Read());
muvjel = Convert.ToChar(Console.Read());
}
public int kiir()
public int szamolas()
{
switch (muvjel)
{
case '+':
@@ -49,7 +41,7 @@ namespace calculator
break;
case '-':
eredm = szam1 +-szam2;
eredm = szam1 - szam2;
break;
case '*':
@@ -63,13 +55,9 @@ namespace calculator
default:
uzen = "Hibás műveleti jel";
break;
}
Console.WriteLine(uzen + eredm);
Console.ReadKey();
return eredm;
return eredm;
}
}
}

View File

@@ -0,0 +1 @@
928a2f392e2cc7f5b3ca8856e93e56308a3914d2

View File

@@ -0,0 +1,8 @@
C:\dev\c#\c-sharp\calculator\bin\x64\Debug\calculator.exe.config
C:\dev\c#\c-sharp\calculator\bin\x64\Debug\calculator.exe
C:\dev\c#\c-sharp\calculator\bin\x64\Debug\calculator.pdb
C:\dev\c#\c-sharp\calculator\obj\x64\Debug\calculator.csproj.AssemblyReference.cache
C:\dev\c#\c-sharp\calculator\obj\x64\Debug\calculator.csproj.SuggestedBindingRedirects.cache
C:\dev\c#\c-sharp\calculator\obj\x64\Debug\calculator.csproj.CoreCompileInputs.cache
C:\dev\c#\c-sharp\calculator\obj\x64\Debug\calculator.exe
C:\dev\c#\c-sharp\calculator\obj\x64\Debug\calculator.pdb

Binary file not shown.

Binary file not shown.