using System;
namespace ConsoleApplication1
{
internal class Program
{
public static void Main(string[] args)
{
var John = new Member("John");
var Susan = new Member("Susan");
John.setPoints(10);
Susan.setPoints(5);
if (John.getPoints() > Susan.getPoints())
{
Console.WriteLine(John.getName());
}
else if (Susan.getPoints() > John.getPoints())
{
Console.WriteLine(Susan.getName());
}
else
{
Console.WriteLine($"Equals for {John.getName()} and {Susan.getName()}");
}
}
}
class Member
{
private string Name;
private int Points;
public string getName()
{
return Name;
}
public int getPoints()
{
return Points;
}
public void setPoints(int P)
{
Points = P;
}
public Member(string name, int points=0)
{
Name = name;
setPoints(points);
}
}
}
Comments
Leave a comment