-
Notifications
You must be signed in to change notification settings - Fork 0
/
SecretAgent.cs
69 lines (60 loc) · 1.55 KB
/
SecretAgent.cs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace secretAgent
{
public class SecretAgent
{
// instance variables
private int ID;
private string name;
private string codename;
private string lang1;
private string lang2;
//Constructor
public SecretAgent(int ID, string name, string codename, string lang1, string lang2)
{
this.ID = ID;
this.name = name;
this.codename = codename;
this.lang1 = lang1;
this.lang2 = lang2;
}
// Get & set for ID
public int Id
{
get { return ID; }
set { ID = value; }
}
// Get & set for name
public string Name
{
get { return name; }
set { name = value; }
}
// Get & set for codename
public string Codename
{
get { return codename; }
set { codename = value; }
}
// Get & set for language
public string Lang1
{
get { return lang1; }
set { lang1 = value; }
}
// Get & set for language nummer 2
public string Lang2
{
get { return lang2; }
set { lang2 = value; }
}
//ToString
public override string ToString()
{
return "Agent " + ID + "'s name is " + name + " codename is " + codename + " and speaks " + lang1 + " and " + lang2;
}
}
}