update
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
calculator/bin/x64/Debug/calculator.exe
Normal file
BIN
calculator/bin/x64/Debug/calculator.exe
Normal file
Binary file not shown.
6
calculator/bin/x64/Debug/calculator.exe.config
Normal file
6
calculator/bin/x64/Debug/calculator.exe.config
Normal 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>
|
||||
BIN
calculator/bin/x64/Debug/calculator.pdb
Normal file
BIN
calculator/bin/x64/Debug/calculator.pdb
Normal file
Binary file not shown.
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
928a2f392e2cc7f5b3ca8856e93e56308a3914d2
|
||||
@@ -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
|
||||
BIN
calculator/obj/x64/Debug/calculator.exe
Normal file
BIN
calculator/obj/x64/Debug/calculator.exe
Normal file
Binary file not shown.
BIN
calculator/obj/x64/Debug/calculator.pdb
Normal file
BIN
calculator/obj/x64/Debug/calculator.pdb
Normal file
Binary file not shown.
Reference in New Issue
Block a user