Constructor
This commit is contained in:
parent
96c1b52110
commit
250764b7ef
|
@ -2,10 +2,16 @@ namespace StaticogIkkestatic;
|
||||||
|
|
||||||
public class Places
|
public class Places
|
||||||
{
|
{
|
||||||
public string PlaceName;
|
public string PlaceName { get; private set; }
|
||||||
public string Municipality;
|
public string Municipality{ get; private set; }
|
||||||
public string Region;
|
public string Region{ get; private set; }
|
||||||
|
|
||||||
|
public Places(string placeName, string municipality, string region)
|
||||||
|
{
|
||||||
|
PlaceName = placeName;
|
||||||
|
Municipality = municipality;
|
||||||
|
Region = region;
|
||||||
|
}
|
||||||
public void ShowPlace()
|
public void ShowPlace()
|
||||||
{
|
{
|
||||||
var labelWidth = 8;
|
var labelWidth = 8;
|
||||||
|
|
|
@ -4,15 +4,11 @@
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var place = new Places();
|
var place = new Places( "Stavern","Larvik", "Vestfold");
|
||||||
place.PlaceName = "Stavern";
|
|
||||||
place.Municipality = "Larvik";
|
var place2 = new Places("Rjukan","Tinn","Telemark");
|
||||||
place.Region = "Vestfold";
|
|
||||||
place.ShowPlace();
|
place.ShowPlace();
|
||||||
var place2 = new Places();
|
|
||||||
place2.PlaceName = "Rjukan";
|
|
||||||
place2.Municipality = "Tinn";
|
|
||||||
place2.Region = "Telemark";
|
|
||||||
place2.ShowPlace();
|
place2.ShowPlace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue