repl.it
@kironroy/

property_types

C#

No description

fork
loading
Files
  • main.cs
  • AddressModel.cs
  • main.exe
main.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

// create a class that has props for
// street address
// city
// state
// zip code 
// add a FullAddress prop read-only

namespace CoreyPropsHW
{
    class Program
    {
        static void Main(string[] args)
        {

            AddressModel address = new AddressModel("123 Fake Street"); // have to set street address here


            // address.Street = "123 Fake Street"; can't set here
            // Console.WriteLine(address.City); can't get here
            address.City = "Springfield";
            address.State = "Jefferson";
            address.ZipCode = "90210";

            Console.WriteLine(address.FullAddressPrintOut);
            
            Console.ReadLine();
        }
    }
}