Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication56
- {
- class Program
- {
- static void Main(string[] args)
- {
- Student student = new Student(17);
- Console.WriteLine(student.GetAdultHood);
- }
- }
- class Student
- {
- private int _age;
- public Student(int age)
- {
- _age = age;
- }
- public int CheckAge
- {
- get { return _age; }
- }
- public string GetAdultHood
- {
- get
- {
- if (_age >= 18)
- return "Совершеннолетний";
- else
- return "Несовершеннолетний";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement