Professional Documents
Culture Documents
class Person
{
private string FirstName;
private string LastName;
private string EmailAddress;
DateTime DateofBirth = new DateTime(1980, 5, 25);
public DateTime now = DateTime.Now;
public Person(string FirstName, string LastName, string EmailAddress)
{
this.FirstName = FirstName;
this.LastName = LastName;
this.EmailAddress = EmailAddress;
}
public bool isAdult()
{
if ((now.Year - DateofBirth.Year) > 18)
{
return true;
}
return false;
}
public string SunSign()
{
int day = DateofBirth.Day;
int month = DateofBirth.Month;
if (month == 12)
{
else if (month == 1)
{
if (day < 20)
astro_sign = "Capricorn";
else
astro_sign = "aquarius";
}
else if (month == 2)
{
if (day < 19)
astro_sign = "Aquarius";
else
astro_sign = "pisces";
}
else if (month == 3)
{
if (day < 21)
astro_sign = "Pisces";
else
astro_sign = "aries";
}
else if (month == 4)
{
if (day < 20)
astro_sign = "Aries";
else
astro_sign = "taurus";
}
else if (month == 5)
{
if (day < 21)
astro_sign = "Taurus";
else
astro_sign = "gemini";
}
else if (month == 6)
{
if (day < 21)
astro_sign = "Gemini";
else
astro_sign = "cancer";
}
else if (month == 7)
{
if (day < 23)
astro_sign = "Cancer";
else
astro_sign = "leo";
}
else if (month == 8)
{
if (day < 23)
astro_sign = "Leo";
else
astro_sign = "virgo";
}
else if (month == 9)
{
if (day < 23)
astro_sign = "Virgo";
else
astro_sign = "libra";
}
}
}
public class MainClass
{
public static void Main()
{
Employee e = new Employee();
if (e.isAdult() == true)
Console.WriteLine("The person's is over 18");
else
Console.WriteLine("The person's is not 18");
if (e.IsBirthday() == true)
Console.WriteLine("The person's birthday is today");
else
Console.WriteLine("The person's birthday is not today");
Console.WriteLine("The sunsign of the person is : " + e.SunSign());
Console.WriteLine("Default screenname : " + e.ScreenName());
}
}