47 lines
965 B
C#
47 lines
965 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|