-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerson.cs
More file actions
44 lines (35 loc) · 1.11 KB
/
Person.cs
File metadata and controls
44 lines (35 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OOP_ProjectEx
{
public class Person
{
//private fields
private string _firsName = "";
private string _lastName = "";
private int _age = 0;
private string _occupation = "";
//public fields
public string FirsName { get { return _firsName;} }
public string LastName { get { return _lastName;} }
public int Age { get { return _age; } }
public string Occupation { get { return _occupation;} }
/// <summary>
/// Constructor
/// </summary>
/// <param name="firstname">First name</param>
/// <param name="lastname">Last name</param>
/// <param name="age">Age</param>
/// <param name="occupation">Occupation</param>
public Person(string firstname, string lastname, int age, string occupation)
{
_firsName = firstname;
_lastName = lastname;
_age = age;
_occupation = occupation;
}
}
}