Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace PersonInfo
- {
- interface IIdentifiable
- {
- string Id { get; set; }
- }
- interface IBirthable
- {
- string Birthdate { get; set; }
- }
- public class Citizen :IIdentifiable,IBirthable
- {
- public Citizen(string name,int age,string id,string birthday)
- {
- Name = name;
- Age = age;
- Id = id;
- Birthdate = birthday;
- }
- public string Name { get; set ; }
- public int Age { get ; set; }
- public string Id { get; set; }
- public string Birthdate { get; set; }
- }
- public class StartUp
- {
- }
- class Program
- {
- static void Main(string[] args)
- {
- string name = Console.ReadLine();
- int age = int.Parse(Console.ReadLine());
- string id = Console.ReadLine();
- string birthday = Console.ReadLine();
- IIdentifiable identifiable = new Citizen(name, age, id, birthday);
- IBirthable birthable = new Citizen(name, age, id, birthday);
- Console.WriteLine(identifiable.Id);
- Console.WriteLine(birthable.Birthdate);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement