Add project files.
This commit is contained in:
46
Test261005Feladat/DataRecord.cs
Normal file
46
Test261005Feladat/DataRecord.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Test261005Feladat
|
||||
{
|
||||
public class DataRecord
|
||||
{
|
||||
public string nev;
|
||||
public int ertek;
|
||||
public DataRecord(string adatsor)
|
||||
{
|
||||
try
|
||||
{
|
||||
nev = adatsor.Split(',')[0];
|
||||
ertek = int.Parse(adatsor.Split(',')[1]);
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
Console.WriteLine(err);
|
||||
}
|
||||
}
|
||||
public int getSquaredValue()
|
||||
{
|
||||
return ertek*ertek;
|
||||
}
|
||||
public double multiplyValue(double szorzo)
|
||||
{
|
||||
return ertek*szorzo;
|
||||
}
|
||||
public bool isEven()
|
||||
{
|
||||
if (ertek%2 == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user